https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/156932
>From 8c3186557a2bc96e3f27a7dde10929990a38288a Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 4 Sep 2025 13:10:06 -0400
Subject: [PATCH 1/4] [DirectX] Add isinf f16 emulation for SM6.8 and lower
fixes #
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/156932
>From 8c3186557a2bc96e3f27a7dde10929990a38288a Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 4 Sep 2025 13:10:06 -0400
Subject: [PATCH 1/3] [DirectX] Add isinf f16 emulation for SM6.8 and lower
fixes #
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/156754
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -51,6 +51,43 @@ static bool resourceAccessNeeds64BitExpansion(Module *M,
Type *OverloadTy,
return ScalarTy->isDoubleTy() || ScalarTy->isIntegerTy(64);
}
+static Value *expand16BitIsInf(CallInst *Orig) {
+ Module *M = Orig->getModule();
+ if (M->getTargetTriple().getDXI
@@ -1331,12 +1331,48 @@ bool SemaHLSL::handleRootSignatureElements(
std::get_if(&Elem)) {
assert(UnboundClauses.size() == Table->NumClauses &&
"Number of unbound elements must match the number of clauses");
+ bool HasSampler = false;
+
https://github.com/farzonl closed
https://github.com/llvm/llvm-project/pull/156932
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -51,6 +51,43 @@ static bool resourceAccessNeeds64BitExpansion(Module *M,
Type *OverloadTy,
return ScalarTy->isDoubleTy() || ScalarTy->isIntegerTy(64);
}
+static Value *expand16BitIsInf(CallInst *Orig) {
+ Module *M = Orig->getModule();
+ if (M->getTargetTriple().getDXI
@@ -180,7 +180,8 @@ class Triple {
DXILSubArch_v1_6,
DXILSubArch_v1_7,
DXILSubArch_v1_8,
-LatestDXILSubArch = DXILSubArch_v1_8,
+DXILSubArch_v1_9,
+LatestDXILSubArch = DXILSubArch_v1_9,
farzonl wrote:
`LatestDXILSubArch` must always mat
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/156932
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/156932
>From 8c3186557a2bc96e3f27a7dde10929990a38288a Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Thu, 4 Sep 2025 13:10:06 -0400
Subject: [PATCH] [DirectX] Add isinf f16 emulation for SM6.8 and lower
fixes #1560
https://github.com/farzonl created
https://github.com/llvm/llvm-project/pull/156932
fixes #156068
- We needed to add a new sub arch to the target tripple so we can test that
emulation does not happen when targeting SM6.9
- The HLSL toolchain needed to be updated to handle the conversion of str
https://github.com/farzonl closed
https://github.com/llvm/llvm-project/pull/156570
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -98,21 +110,98 @@ void applySPIRVDistance(MachineInstr &MI,
MachineRegisterInfo &MRI,
SPIRVGlobalRegistry *GR =
MI.getMF()->getSubtarget().getSPIRVGlobalRegistry();
- auto RemoveAllUses = [&](Register Reg) {
-SmallVector UsesToErase(
-llvm::make_pointe
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/156570
>From dfbef577e4b6785296b59254dc4e4ec760f35b24 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Fri, 29 Aug 2025 14:49:31 -0400
Subject: [PATCH 1/2] [SPIRV] Add OpInf support for isinf hlsl intrinsic
fixes #14
https://github.com/farzonl created
https://github.com/llvm/llvm-project/pull/156570
fixes #148051
- update EmitHLSLBuiltinExpr in CGHLSLBuiltins.cpp to toggle intrinsics by
target
- Add a GENERATE_HLSL_INTRINSIC_FUNCTION for isinf in CGHLSLRuntime.h
- Update the SPIRVInstructionSelector.cpp to
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/156570
>From dfbef577e4b6785296b59254dc4e4ec760f35b24 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Fri, 29 Aug 2025 14:49:31 -0400
Subject: [PATCH] [SPIRV] Add OpInf support for isinf hlsl intrinsic
fixes #148051
https://github.com/farzonl closed
https://github.com/llvm/llvm-project/pull/154620
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/154620
>From b51b68d7b5e7019687f2b8617178f2a8d9932278 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Wed, 20 Aug 2025 17:11:37 -0400
Subject: [PATCH 01/14] [DirectX] Make dx.RawBuffer an op that can't be
replaced
farzonl wrote:
current failure is `Clang-Unit ::
./AllClangUnitTests/TimeProfilerTest/ConstantEvaluationCxx20`. Which is not
related to this PRs changes.
https://github.com/llvm/llvm-project/pull/154620
___
cfe-commits mailing list
cfe-commits@lists.
farzonl wrote:
Wait for Justin or Chris, this isn't my area of expertise.
https://github.com/llvm/llvm-project/pull/154454
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/154454
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -295,6 +295,32 @@ void tools::hlsl::MetalConverter::ConstructJob(
Exec, CmdArgs, Inputs, Input));
}
+void tools::LLVMObjcopy::ConstructJob(Compilation &C, const JobAction &JA,
+ const InputInfo &O
@@ -396,7 +396,7 @@ class ClangGCC
}
// HLSL Annotation spellings
-class HLSLAnnotation : Spelling;
+class HLSLAnnotation : Spelling {}
farzonl wrote:
curious why this line changed?
https://github.com/llvm/llvm-project/pull/152537
___
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/152781
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=?utf-8?q?Mészáros?= Gergely ,
=?utf-8?q?Mészáros?= Gergely ,Gergely
Meszaros
Message-ID:
In-Reply-To:
https://github.com/farzonl approved this pull request.
>From an HLSL perspective this change is fine. Approval subject to satisying
>concerns for SYCL and general Sema issues that other dom
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -finclude-default-header -fnative-half-type -triple \
-// RUN: dxil-pc-shadermodel6.3-compute %s -emit-llvm -o - | \
+// RUN: dxil-pc-shadermodel6.4-compute %s -emit-llvm -o - | \
farzonl wrote:
Should we add an error test
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/150634
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl closed
https://github.com/llvm/llvm-project/pull/151353
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/151353
>From b5f34ee30c375fb90fb2d4d1e4cdbb417a30812b Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Wed, 30 Jul 2025 11:32:38 -0400
Subject: [PATCH 1/3] [HLSL] fix D3DCOLORtoUBYTE4 return type to be int
fixes #150
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/151353
>From b5f34ee30c375fb90fb2d4d1e4cdbb417a30812b Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Wed, 30 Jul 2025 11:32:38 -0400
Subject: [PATCH 1/3] [HLSL] fix D3DCOLORtoUBYTE4 return type to be int
fixes #150
farzonl wrote:
> Should we just use ar/ranlib instead of libtool on Apple platform? I'm not
> sure how much performance difference there is between ar and libtool.
I'm pretty sure if you use an entirely llvm based tool chain that is what is
happening and you won't see this error. The problem I
https://github.com/farzonl deleted
https://github.com/llvm/llvm-project/pull/151353
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/151353
>From b5f34ee30c375fb90fb2d4d1e4cdbb417a30812b Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Wed, 30 Jul 2025 11:32:38 -0400
Subject: [PATCH 1/2] [HLSL] fix D3DCOLORtoUBYTE4 return type to be int
fixes #150
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/151353
>From f89ea77874da5f5964a857f6871476058a9bc673 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Wed, 30 Jul 2025 11:32:38 -0400
Subject: [PATCH 1/2] [HLSL] fix D3DCOLORtoUBYTE4 return type to be int
fixes #150
https://github.com/farzonl created
https://github.com/llvm/llvm-project/pull/151353
fixes #150673
fixes #150678
The issue was we were using the wrong return type.
>From f89ea77874da5f5964a857f6871476058a9bc673 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Wed, 30 Jul 2025 11:32:38 -0400
S
https://github.com/farzonl approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/150495
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,4 +1,4 @@
-//===--- AMDCPU.cpp - Emit LLVM Code for builtins
-===//
+//===--- BuiltinAMDCPU.cpp - Emit LLVM Code for builtins
--===//
farzonl wrote:
```suggestion
//===--- BuiltinAMDGPU.cpp - Emit LLVM Code for
farzonl wrote:
This change will absolutely fix the issue, I was advised on my few attempts
that we want to be able to keep the same name and the fix should be in cmake
and not a file rename.
For example We have many `AMDGPU.cpp`
- clang/lib/Basic/Targets/AMDGPU.cpp
- clang/lib/CodeGen/Targets/
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/147342
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -O1 -triple spirv-pc-vulkan-compute %s -emit-llvm -o - |
FileCheck %s
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+typedef float float3 __attribute__((ext_vector_type(3)));
+typedef float float4 __attribute__((ext_vector_type(
@@ -235,6 +288,30 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(const
TargetInfo &TI,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_refract: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+llvm::function_ref
+C
@@ -71,6 +71,17 @@ constexpr vector reflect_vec_impl(vector I,
vector N) {
#endif
}
+template constexpr T refract_impl(T I, T N, U Eta) {
+#if (__has_builtin(__builtin_spirv_refract))
+ if (is_vector::value)
farzonl wrote:
It looks like SPIRV refract does
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/147342
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,36 @@
+; RUN: llc -O0 -mtriple=spirv-unknown-vulkan %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o -
-filetype=obj | spirv-val %}
farzonl wrote:
There is no spirv64 target if you want to use the glsl e
@@ -235,6 +288,30 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(const
TargetInfo &TI,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_refract: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+llvm::function_ref
+C
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/147342
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -475,6 +475,65 @@ reflect(__detail::HLSL_FIXED_VECTOR I,
return __detail::reflect_vec_impl(I, N);
}
+//===--===//
+// refract builtin
+//===
@@ -71,6 +71,42 @@ constexpr vector reflect_vec_impl(vector I,
vector N) {
#endif
}
+template constexpr T refract_impl(T I, T N, T Eta) {
+ T Mul = N * I;
+ T K = 1 - Eta * Eta * (1 - (Mul * Mul));
+ T Result = (Eta * I - (Eta * Mul + sqrt(K)) * N);
+ return select(K < 0
@@ -475,6 +475,65 @@ reflect(__detail::HLSL_FIXED_VECTOR I,
return __detail::reflect_vec_impl(I, N);
}
+//===--===//
+// refract builtin
+//===
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/143909
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
farzonl wrote:
There is an advantage to intrinsics that builtins lack in that intrinsics being
entirely a backend feature set makes it easier to support non clang based
frontends. Say we wanted to do something MLIR based.
https://github.com/llvm/llvm-project/pull/143909
__
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/136026
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/145334
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -676,35 +676,23 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned
BuiltinID,
case Builtin::BI__builtin_hlsl_wave_active_sum: {
// Due to the use of variadic arguments, explicitly retreive argument
Value *OpExpr = EmitScalarExpr(E->getArg(0));
-llvm::Func
Nathan =?utf-8?q?Gau=C3=ABr?= ,
Nathan =?utf-8?q?Gau=C3=ABr?= ,
Nathan =?utf-8?q?Gau=C3=ABr?= ,
Nathan =?utf-8?q?Gau=C3=ABr?= ,
Nathan =?utf-8?q?Gau=C3=ABr?=
Message-ID:
In-Reply-To:
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/141759
__
Nathan =?utf-8?q?Gauër?= ,
Nathan =?utf-8?q?Gauër?= ,
Nathan =?utf-8?q?Gauër?= ,
Nathan =?utf-8?q?Gauër?= ,
Nathan =?utf-8?q?Gauër?=
Message-ID:
In-Reply-To:
@@ -1147,6 +1154,26 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D,
const ParsedAttr &AL) {
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/143519
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Nathan =?utf-8?q?Gauër?= ,
Nathan =?utf-8?q?Gauër?= ,
Nathan =?utf-8?q?Gauër?= ,
Nathan =?utf-8?q?Gauër?= ,
Nathan =?utf-8?q?Gauër?=
Message-ID:
In-Reply-To:
@@ -1147,6 +1154,26 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D,
const ParsedAttr &AL) {
@@ -1147,6 +1154,26 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D,
const ParsedAttr &AL) {
HLSLSV_DispatchThreadIDAttr(getASTContext(), AL));
}
+bool SemaHLSL::diagnosePositionType(QualType T, const ParsedAttr &AL) {
+ const auto *VT = T->getAs();
@@ -764,6 +764,13 @@ void SemaHLSL::CheckSemanticAnnotation(
return;
DiagnoseAttrStageMismatch(AnnotationAttr, ST, {llvm::Triple::Compute});
break;
+ case attr::HLSLSV_Position:
+// TODO: allow use on other shader types & output once the overall semantic
@@ -407,6 +429,13 @@ llvm::Value *CGHLSLRuntime::emitInputSemantic(IRBuilder<>
&B,
llvm::Function *GroupIDIntrinsic = CGM.getIntrinsic(getGroupIdIntrinsic());
return buildVectorInput(B, GroupIDIntrinsic, Ty);
}
+ if (D.hasAttr()) {
+if (getArch() == llvm::Triple
@@ -384,6 +384,28 @@ static Value *buildVectorInput(IRBuilder<> &B, Function
*F, llvm::Type *Ty) {
return B.CreateCall(F, {B.getInt32(0)});
}
+static void addBuiltinDecoration(llvm::GlobalVariable *GV, unsigned BuiltIn) {
+ LLVMContext &Ctx = GV->getContext();
+ IRBuilder
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/141759
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -384,6 +384,28 @@ static Value *buildVectorInput(IRBuilder<> &B, Function
*F, llvm::Type *Ty) {
return B.CreateCall(F, {B.getInt32(0)});
}
+static void addBuiltinDecoration(llvm::GlobalVariable *GV, unsigned BuiltIn) {
+ LLVMContext &Ctx = GV->getContext();
+ IRBuilder
@@ -8472,6 +8472,20 @@ The full documentation is available here:
https://docs.microsoft.com/en-us/windo
}];
}
+def HLSLSV_PositionDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``SV_Position`` semantic, when applied to an input parameter i
@@ -8472,6 +8472,20 @@ The full documentation is available here:
https://docs.microsoft.com/en-us/windo
}];
}
+def HLSLSV_PositionDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``SV_Position`` semantic, when applied to an input parameter i
@@ -2350,6 +2350,10 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_is_first_lane)
__attribute__((convergent)) bool WaveIsFirstLane();
+_HLSL_AVAILABILITY(shadermodel, 6.0)
+_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_get_lane_count)
+__attribute__(
@@ -4909,6 +4909,12 @@ def HLSLWaveReadLaneAt : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}
+def HLSLWaveGetLaneCount : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_wave_get_lane_count"];
+ let Attributes = [NoThrow, Const];
+ let Prototype
https://github.com/farzonl approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/143127
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -691,6 +691,11 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned
BuiltinID,
return EmitRuntimeCall(
Intrinsic::getOrInsertDeclaration(&CGM.getModule(), ID));
}
+ case Builtin::BI__builtin_hlsl_wave_get_lane_count: {
+Intrinsic::ID ID = CGM.getHLSLRu
@@ -4909,6 +4909,12 @@ def HLSLWaveReadLaneAt : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}
+def HLSLWaveGetLaneCount : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_wave_get_lane_count"];
+ let Attributes = [NoThrow, Const];
+ let Prototype
@@ -106,3 +106,57 @@ define i32 @all_imm() {
%2 = sext i8 %1 to i32
ret i32 %2
}
+
+define i32 @scalar_i8_geps() {
+ ; CHECK-LABEL: define i32 @scalar_i8_geps(
+ ; CHECK-NEXT:[[ALLOCA:%.*]] = alloca i32, align 4
+ ; CHECK-NEXT:[[GEP:%.*]] = getelementptr inbounds
https://github.com/farzonl updated
https://github.com/llvm/llvm-project/pull/142475
>From 244b01e43f4c974c682c90d1315c59605da2b289 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi
Date: Mon, 2 Jun 2025 15:40:22 -0400
Subject: [PATCH 1/5] [DirectX] add GEP i8 legalization The i8 legalization
code in
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/142401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
farzonl wrote:
@Naghasan @VyacheslavLevytskyy there is an issue in SemaSPIRV.cpp
```
clang/lib/Sema/SemaSPIRV.cpp:132:3: error: default label in switch which covers
all enumeration values [-Werror,-Wcovered-switch-default]
132 | default:
| ^
1 error generated.
```
https://github.co
@@ -20,7 +20,7 @@ namespace clang {
class SemaSPIRV : public SemaBase {
public:
SemaSPIRV(Sema &S);
-
+ bool CheckVectorArgs(CallExpr *TheCall, unsigned NumArgsToCheck);
farzonl wrote:
This is a helper, we don't need to expose it in the class. No one needs
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 %s -triple spirv-pc-vulkan-compute -verify
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+
+float2 test_no_second_arg(float2 p0) {
+ return __builtin_spirv_refract(p0);
+ // expected-error@-1 {{too few arguments to function cal
@@ -26,6 +26,12 @@ def SPIRVReflect : Builtin {
let Prototype = "void(...)";
}
+def SPIRVRefract : Builtin {
+ let Spellings = ["__builtin_spirv_refract"];
+ let Attributes = [NoThrow, Const];
farzonl wrote:
You need to add `CustomTypeChecking`.
```sugges
@@ -0,0 +1,290 @@
+// RUN: %clang_cc1 -finclude-default-header -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -finclude-default-header -triple \
+// RUN: spirv-unknown-vulkan-compute %s -f
@@ -2507,13 +2441,9 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
case Builtin::BI__builtin_hlsl_dot: {
-if (SemaRef.checkArgCount(TheCall, 2))
farzonl wrote:
a comment to this effect would be good, b
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/138429
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/140627
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl approved this pull request.
https://github.com/llvm/llvm-project/pull/140315
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,63 @@
+# RUN: llc -verify-machineinstrs -O0 -mtriple spirv-unknown-unknown
-run-pass=spirv-prelegalizer-combiner %s -o - | FileCheck %s
+# REQUIRES: asserts
+---
+name:faceforward_instcombine_float
+tracksRegLiveness: true
+legalized: true
+body:
@@ -0,0 +1,63 @@
+# RUN: llc -verify-machineinstrs -O0 -mtriple spirv-unknown-unknown
-run-pass=spirv-prelegalizer-combiner %s -o - | FileCheck %s
+# REQUIRES: asserts
+---
+name:faceforward_instcombine_float
+tracksRegLiveness: true
+legalized: true
+body:
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/139959
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/139959
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -98,21 +110,98 @@ void applySPIRVDistance(MachineInstr &MI,
MachineRegisterInfo &MRI,
SPIRVGlobalRegistry *GR =
MI.getMF()->getSubtarget().getSPIRVGlobalRegistry();
- auto RemoveAllUses = [&](Register Reg) {
-SmallVector UsesToErase(
-llvm::make_pointe
@@ -0,0 +1,63 @@
+# RUN: llc -verify-machineinstrs -O0 -mtriple spirv-unknown-unknown
-run-pass=spirv-prelegalizer-combiner %s -o - | FileCheck %s
+# REQUIRES: asserts
+---
+name:faceforward_instcombine_float
+tracksRegLiveness: true
+legalized: true
+body:
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/139959
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/farzonl edited
https://github.com/llvm/llvm-project/pull/139959
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,63 @@
+# RUN: llc -verify-machineinstrs -O0 -mtriple spirv-unknown-unknown
-run-pass=spirv-prelegalizer-combiner %s -o - | FileCheck %s
+# REQUIRES: asserts
+---
+name:faceforward_instcombine_float
+tracksRegLiveness: true
+legalized: true
+body:
@@ -0,0 +1,13 @@
+; RUN: not llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s
-o /dev/null 2>&1 | FileCheck %s
+; RUN: not llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s
-o /dev/null 2>&1 | FileCheck %s
+
+; CHECK: LLVM ERROR: %{{.*}} = G_INTR
@@ -42,47 +42,47 @@ float2 test_mad_element_type_mismatch(half2 p0, float2 p1) {
float2 test_builtin_mad_float2_splat(float p0, float2 p1) {
return __builtin_hlsl_mad(p0, p1, p1);
- // expected-error@-1 {{all arguments to '__builtin_hlsl_mad' must be
vectors}}
+ // expect
@@ -2507,13 +2441,9 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
case Builtin::BI__builtin_hlsl_dot: {
-if (SemaRef.checkArgCount(TheCall, 2))
farzonl wrote:
Why did you remove this? Since you are le
@@ -2446,37 +2376,41 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
case Builtin::BI__builtin_hlsl_any: {
if (SemaRef.checkArgCount(TheCall, 1))
return true;
+if (CheckAnyScalarOrVector(&SemaRef, TheCall, 0))
+ return t
@@ -2446,37 +2376,41 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
case Builtin::BI__builtin_hlsl_any: {
if (SemaRef.checkArgCount(TheCall, 1))
return true;
+if (CheckAnyScalarOrVector(&SemaRef, TheCall, 0))
+ return t
@@ -2446,37 +2376,41 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
case Builtin::BI__builtin_hlsl_any: {
if (SemaRef.checkArgCount(TheCall, 1))
return true;
+if (CheckAnyScalarOrVector(&SemaRef, TheCall, 0))
+ return t
@@ -2446,37 +2376,41 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
case Builtin::BI__builtin_hlsl_any: {
if (SemaRef.checkArgCount(TheCall, 1))
return true;
+if (CheckAnyScalarOrVector(&SemaRef, TheCall, 0))
+ return t
@@ -2164,30 +2083,48 @@ static bool CheckModifiableLValue(Sema *S, CallExpr
*TheCall,
return true;
}
-static bool CheckNoDoubleVectors(Sema *S, CallExpr *TheCall) {
- auto checkDoubleVector = [](clang::QualType PassedType) -> bool {
-if (const auto *VecTy = PassedType-
1 - 100 of 1390 matches
Mail list logo