@@ -95,6 +99,126 @@ static void initializeAlloca(CodeGenFunction &CGF,
AllocaInst *AI, Value *Size,
I->addAnnotationMetadata("auto-init");
}
+static Value *handleHlslSplitdouble(const CallExpr *E, CodeGenFunction *CGF) {
+ Value *Op0 = CGF->EmitScalarExpr(E->getArg(0));
+
https://github.com/tex3d created
https://github.com/llvm/llvm-project/pull/112461
The test `clang/test/CodeGen/2004-02-20-Builtins.c` will erroneously fail if
"builtin" is in the path to your source tree.
This change adds a `CHECK-LABEL !llvm.ident` after the `CHECK-NOT` to avoid
searching in
https://github.com/tex3d updated
https://github.com/llvm/llvm-project/pull/113636
>From a6776121bb118fe4083ccb94fa582cca1aef7f9b Mon Sep 17 00:00:00 2001
From: Tex Riddell
Date: Tue, 15 Oct 2024 16:18:44 -0700
Subject: [PATCH 1/3] Emit constrained atan2 intrinsic for clang builtin
This change
@@ -343,27 +336,224 @@ struct TemplateParameterListBuilder {
Params.clear();
QualType T = Builder.Template->getInjectedClassNameSpecialization();
-T = S.Context.getInjectedClassNameType(Builder.Record, T);
+T = AST.getInjectedClassNameType(Builder.Record, T);
@@ -2161,6 +2186,22 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_buffer_update_counter: {
+if (SemaRef.checkArgCount(TheCall, 2) ||
+CheckResourceHandle(&Sema
@@ -1880,6 +1880,31 @@ static bool CheckVectorSelect(Sema *S, CallExpr
*TheCall) {
return false;
}
+static bool CheckResourceHandle(Sema *S, CallExpr *TheCall, unsigned ArgIndex)
{
+ assert(TheCall->getNumArgs() >= ArgIndex);
+ QualType ArgType = TheCall->getArg(ArgIndex
@@ -2161,6 +2186,22 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_buffer_update_counter: {
+if (SemaRef.checkArgCount(TheCall, 2) ||
+CheckResourceHandle(&Sema
@@ -553,3 +748,20 @@ void HLSLExternalSemaSource::CompleteType(TagDecl *Tag) {
return;
It->second(Record);
}
+
+static FunctionDecl *lookupBuiltinFunction(Sema &S, StringRef Name) {
+ IdentifierInfo &II =
+ S.getASTContext().Idents.get(Name, tok::TokenKind::identifi
@@ -343,27 +336,224 @@ struct TemplateParameterListBuilder {
Params.clear();
QualType T = Builder.Template->getInjectedClassNameSpecialization();
-T = S.Context.getInjectedClassNameType(Builder.Record, T);
+T = AST.getInjectedClassNameType(Builder.Record, T);
https://github.com/tex3d deleted
https://github.com/llvm/llvm-project/pull/114148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tex3d deleted
https://github.com/llvm/llvm-project/pull/114148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2161,6 +2186,22 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_buffer_update_counter: {
+if (SemaRef.checkArgCount(TheCall, 2) ||
+CheckResourceHandle(&Sema
@@ -553,3 +748,20 @@ void HLSLExternalSemaSource::CompleteType(TagDecl *Tag) {
return;
It->second(Record);
}
+
+static FunctionDecl *lookupBuiltinFunction(Sema &S, StringRef Name) {
+ IdentifierInfo &II =
+ S.getASTContext().Idents.get(Name, tok::TokenKind::identifi
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify
+
+using handle_t = __hlsl_resource_t [[hlsl::resource_class(UAV)]]
[[hlsl::contained_type(int)]];
tex3d wrote:
@@ -35,6 +35,9 @@ def int_dx_typedBufferLoad_checkbit
def int_dx_typedBufferStore
: DefaultAttrsIntrinsic<[], [llvm_any_ty, llvm_i32_ty, llvm_anyvector_ty]>;
+def int_dx_bufferUpdateCounter
+: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_any_ty, llvm_i32_ty],
[IntrWrite
@@ -343,27 +336,224 @@ struct TemplateParameterListBuilder {
Params.clear();
QualType T = Builder.Template->getInjectedClassNameSpecialization();
-T = S.Context.getInjectedClassNameType(Builder.Record, T);
+T = AST.getInjectedClassNameType(Builder.Record, T);
https://github.com/tex3d approved this pull request.
I think this will do for now, since most of this will have to be reworked for
general semantics support anyway.
https://github.com/llvm/llvm-project/pull/115911
___
cfe-commits mailing list
cfe-comm
@@ -271,53 +246,70 @@ struct BuiltinTypeDeclBuilder {
return *this;
}
+ FieldDecl *getResourceHandleField() {
+FieldDecl *FD = Fields["h"];
tex3d wrote:
I thought `lookup` was right:
https://github.com/llvm/llvm-project/blob/30af6fb163add17a6be5152
https://github.com/tex3d edited https://github.com/llvm/llvm-project/pull/113636
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tex3d approved this pull request.
Looks good.
https://github.com/llvm/llvm-project/pull/117789
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -564,9 +585,9 @@ struct BuiltinTypeMethodBuilder {
OK_Ordinary);
}
- BuiltinTypeMethodBuilder &
- callBuiltin(StringRef BuiltinName, ArrayRef CallParms,
- bool AddResourceHandleAsFirstArg = true) {
+ template
+ Built
https://github.com/tex3d closed https://github.com/llvm/llvm-project/pull/115911
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tex3d approved this pull request.
LGTM.
https://github.com/llvm/llvm-project/pull/117648
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -49,3 +49,28 @@ void CSMain3_GID(uint3 : SV_GroupID) {
// CHECK-NEXT: ParmVarDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> col:24 'uint3'
// CHECK-NEXT: HLSLSV_GroupIDAttr
}
+
+[numthreads(8,8,1)]
+void CSMain_GThreadID(uint ID : SV_GroupThreadID) {
+// CHECK: FunctionDecl 0x{{[0-9a-fA-F
@@ -2,15 +2,18 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-mesh -hlsl-entry CSMain -x
hlsl -finclude-default-header -verify -o - %s
[numthreads(8,8,1)]
-// expected-error@+3 {{attribute 'SV_GroupIndex' is unsupported in 'mesh'
shaders, requires compute}}
-// expect
https://github.com/tex3d approved this pull request.
I think it's good, with minor nit about unnecessary comments.
https://github.com/llvm/llvm-project/pull/117781
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/m
@@ -2851,7 +2851,21 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
.constrainAllUses(TII, TRI, RBI);
break;
case Intrinsic::spv_thread_id:
-return selectSpvThreadId(ResVReg, ResType, I);
+// The HLSL SV_DispatchThreadID semantic is
@@ -3606,6 +3613,32 @@ bool
SPIRVInstructionSelector::selectSpvThreadId(Register ResVReg,
return Result && MIB.constrainAllUses(TII, TRI, RBI);
}
+bool SPIRVInstructionSelector::selectSpvThreadId(Register ResVReg,
+ const SPIR
@@ -3606,6 +3613,32 @@ bool
SPIRVInstructionSelector::selectSpvThreadId(Register ResVReg,
return Result && MIB.constrainAllUses(TII, TRI, RBI);
}
+bool SPIRVInstructionSelector::selectSpvThreadId(Register ResVReg,
+ const SPIR
@@ -3606,6 +3613,32 @@ bool
SPIRVInstructionSelector::selectSpvThreadId(Register ResVReg,
return Result && MIB.constrainAllUses(TII, TRI, RBI);
}
+bool SPIRVInstructionSelector::selectSpvThreadId(Register ResVReg,
+ const SPIR
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
@@ -110,6 +131,24 @@ float2 HowManyFloats(float V) {
return V.rr.rr;
}
+// CHECK-LABEL: HowManyBools
+// CHECK: [[VAddr:%.*]] = alloca i32, align 4
+// CHECK-NEXT: [[Vec2Ptr:%.*]] = alloca <2 x i32>, align 8
+// CHECK-NEXT: [[Tmp:%.*]] = zext i1 {{.*}} to i32
+// CHECK-NEXT:
https://github.com/tex3d commented:
This is interesting.
I wonder though what it looks like in the AST when initializing something with
the result of a function call that return an aggregate that must be split up
across different boundaries? Or what about expressions with side-effects? How
tex3d wrote:
> How does it not duplicate sub-expressions while also not creating temporary
> variables to capture results?
The way I thought of to comprehensively solve this in a clear general way was
to:
- create a new temporary with an anonymous struct type containing the exact
sequence of
https://github.com/tex3d approved this pull request.
Looks good!
https://github.com/llvm/llvm-project/pull/128086
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -172,6 +172,23 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool
CBuffer,
return Result;
}
+static unsigned calculateLegacyCbufferFieldAlign(const ASTContext &Context,
+ QualType T) {
+ // Arrays and Structs are
@@ -172,6 +172,23 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool
CBuffer,
return Result;
}
+static unsigned calculateLegacyCbufferFieldAlign(const ASTContext &Context,
+ QualType T) {
+ // Arrays and Structs are
https://github.com/tex3d approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/130222
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tex3d unassigned
https://github.com/llvm/llvm-project/pull/130222
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
101 - 142 of 142 matches
Mail list logo