https://github.com/damyanp approved this pull request.
https://github.com/llvm/llvm-project/pull/101433
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -551,24 +541,21 @@ getHLSLResourceAttrFromEitherDecl(VarDecl *VD,
// the resource attr could be on the record decl itself or on one of
// its fields (the resource handle, most commonly)
damyanp wrote:
I was going to add a comment about the name of
@@ -551,24 +541,21 @@ getHLSLResourceAttrFromEitherDecl(VarDecl *VD,
// the resource attr could be on the record decl itself or on one of
// its fields (the resource handle, most commonly)
-const auto *Attr = TheRecordDecl->getAttr();
+const auto *Attr = TheRec
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/97103
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -459,7 +468,407 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc));
}
-void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) {
+struct RegisterBindingFlags {
@@ -459,7 +468,407 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc));
}
-void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) {
+struct RegisterBindingFlags {
@@ -459,7 +468,407 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc));
}
-void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) {
+struct RegisterBindingFlags {
@@ -0,0 +1,131 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// TODO: Implement "Buffer", we use a substitute UDT
+// to test the 't' binding type for this test.
+
+template
+struct [[hlsl::resource_class(SRV)]] MyTemplated
https://github.com/damyanp requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/97103
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// This test validates the diagnostics that are emitted when a variable with a
"resource" type
+// is bound to a register using the register annotation
+
+// expe
@@ -459,7 +468,413 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc));
}
-void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) {
+struct RegisterBindingFlags {
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// This test validates the diagnostics that are emitted when a variable with a
"resource" type
+// is bound to a register using the register annotation
+
+// expe
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// TODO: Implement "Buffer"
+struct Eg1 {
+ float f;
+ // Buffer Buf;
+ RWBuffer RWBuf;
+ };
+Eg1 e1 : /* register(t0) :*/ register(u0);
+// Valid: f is skip
@@ -459,7 +468,413 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc));
}
-void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) {
+struct RegisterBindingFlags {
@@ -492,14 +999,21 @@ void SemaHLSL::handleResourceBindingAttr(Decl *D, const
ParsedAttr &AL) {
// Validate.
if (!Slot.empty()) {
switch (Slot[0]) {
damyanp wrote:
This still seems to be essentially a duplicate of `getRegisterTypeIndex`. You
may nee
@@ -459,7 +468,413 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc));
}
-void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) {
+struct RegisterBindingFlags {
@@ -0,0 +1,131 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// TODO: Implement "Buffer", we use a substitute UDT
+// to test the 't' binding type for this test.
damyanp wrote:
I don't think that this TODO
@@ -459,7 +468,413 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc));
}
-void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) {
+struct RegisterBindingFlags {
https://github.com/damyanp approved this pull request.
https://github.com/llvm/llvm-project/pull/104656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -31,6 +31,7 @@ class SemaHLSL : public SemaBase {
public:
SemaHLSL(Sema &S);
+ HLSLResourceAttr *mergeHLSLResourceAttr(bool CBuffer);
damyanp wrote:
I don't think `mergeHLSLResourceAttr` exists any more?
https://github.com/llvm/llvm-project/pull/97103
@@ -0,0 +1,71 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// This test validates the diagnostics that are emitted when a variable with a
"resource" type
+// is bound to a register using the register annotation
+
+/*
+tem
https://github.com/damyanp requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/97103
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -459,7 +467,408 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc));
}
-void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) {
+struct RegisterBindingFlags {
@@ -0,0 +1,131 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// TODO: Implement "Buffer", we use a substitute UDT
+// to test the 't' binding type for this test.
+
+template
+struct [[hlsl::resource_class(SRV)]] MyTemplated
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc));
}
-void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) {
+struct RegisterBindingFlags {
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// This test validates the diagnostics that are emitted when a variable with a
"resource" type
+// is bound to a register using the register annotation
+
+// expe
@@ -0,0 +1,71 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// This test validates the diagnostics that are emitted when a variable with a
"resource" type
+// is bound to a register using the register annotation
+
+/*
+tem
https://github.com/damyanp requested changes to this pull request.
A few open issues I'd like to see addressed before approving this:
* https://github.com/llvm/llvm-project/pull/97103#discussion_r1720126674
* https://github.com/llvm/llvm-project/pull/97103#discussion_r1722532927
* https://github
@@ -551,24 +541,21 @@ getHLSLResourceAttrFromEitherDecl(VarDecl *VD,
// the resource attr could be on the record decl itself or on one of
// its fields (the resource handle, most commonly)
-const auto *Attr = TheRecordDecl->getAttr();
+const auto *Attr = TheRec
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// This test validates the diagnostics that are emitted when a variable with a
"resource" type
+// is bound to a register using the register annotation
+
+// expe
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// This test validates the diagnostics that are emitted when a variable with a
"resource" type
+// is bound to a register using the register annotation
+
+// expe
@@ -459,7 +467,408 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc));
}
-void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) {
+struct RegisterBindingFlags {
https://github.com/damyanp approved this pull request.
Thank you!
https://github.com/llvm/llvm-project/pull/97103
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
damyanp wrote:
We should get the proposal approved before implementing it.
https://github.com/llvm/llvm-project/pull/104239
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp approved this pull request.
https://github.com/llvm/llvm-project/pull/106096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -o -
-disable-llvm-passes %s | FileCheck %s
+
+// Verify that no per variable _Init_thread instructions are emitted for
non-trivial static locals
+// These would normally be emitted by the Mic
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -o -
-disable-llvm-passes %s | FileCheck %s
+
+// Verify that no per variable _Init_thread instructions are emitted for
non-trivial static locals
+// These would normally be emitted by the Mic
@@ -2646,6 +2646,9 @@ bool Parser::ParseCXXMemberDeclaratorBeforeInitializer(
else
DeclaratorInfo.SetIdentifier(nullptr, Tok.getLocation());
+ if (getLangOpts().HLSL)
damyanp wrote:
I'm not proposing we combine them. My observation is that one of them
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/96346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp approved this pull request.
https://github.com/llvm/llvm-project/pull/96346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp approved this pull request.
https://github.com/llvm/llvm-project/pull/108128
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
damyanp wrote:
Seems that this change is doing a bit more than just adding a new version of
popcount. Can the description be updated appropriately please?
https://github.com/llvm/llvm-project/pull/108121
___
cfe-commits mailing list
cfe-commits@lists
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp approved this pull request.
LGTM - I think one of the test cases may be redundant (or in the wrong file).
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.
@@ -1,5 +1,24 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
@@ -1,5 +1,24 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
https://github.com/damyanp requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// expected-error@+1 {{'register' attribute only ap
https://github.com/damyanp deleted
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp approved this pull request.
https://github.com/llvm/llvm-project/pull/107954
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6168,10 +6168,19 @@ class HLSLAttributedResourceType : public Type, public
llvm::FoldingSetNode {
struct Attributes {
// Data gathered from HLSL resource attributes
llvm::dxil::ResourceClass ResourceClass;
+
+LLVM_PREFERRED_TYPE(bool)
uint8_t IsROV : 1;
@@ -6168,10 +6168,19 @@ class HLSLAttributedResourceType : public Type, public
llvm::FoldingSetNode {
struct Attributes {
// Data gathered from HLSL resource attributes
llvm::dxil::ResourceClass ResourceClass;
+
+LLVM_PREFERRED_TYPE(bool)
uint8_t IsROV : 1;
@@ -6168,10 +6168,19 @@ class HLSLAttributedResourceType : public Type, public
llvm::FoldingSetNode {
struct Attributes {
// Data gathered from HLSL resource attributes
llvm::dxil::ResourceClass ResourceClass;
+
+LLVM_PREFERRED_TYPE(bool)
uint8_t IsROV : 1;
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o
- %s | FileCheck %s
damyanp wrote:
Presumably we have tests somewhere for resource handles that don't have
raw_buffer on them, and they just don't show up here beca
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp approved this pull request.
I'm marking this as approved - I think that there's some cleanup and
rearranging of the tests here that would improve this change.
It might be worth trying to get a review with someone who has more experience
of testing strategies for thes
@@ -0,0 +1,66 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// valid
+cbuffer cbuf {
+RWBuffer r : register(u0, space0);
+}
+
+cbuffer cbuf2 {
+struct x {
+// this test validates that no diagnostic is emitte
@@ -0,0 +1,66 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
damyanp wrote:
This file seems to now mostly be testing non-error cases of specifying a space
for registers. I think it'd probably be better to ju
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/106782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp commented:
LGTM - reviewed mostly to see if I could read and get a high level gist of what
it was doing. I'm afraid I've not carefully looked through the real meat of
this change.
https://github.com/llvm/llvm-project/pull/108659
_
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/108659
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -12881,6 +12886,12 @@ QualType Sema::CheckVectorLogicalOperands(ExprResult
&LHS, ExprResult &RHS,
if (!getLangOpts().CPlusPlus &&
!(isa(vType->getAs(
return InvalidLogicalVectorOperands(Loc, LHS, RHS);
+ if (getLangOpts().HLSL &&
+ getLangOpts().getHLS
@@ -12881,6 +12886,12 @@ QualType Sema::CheckVectorLogicalOperands(ExprResult
&LHS, ExprResult &RHS,
if (!getLangOpts().CPlusPlus &&
!(isa(vType->getAs(
return InvalidLogicalVectorOperands(Loc, LHS, RHS);
+ if (getLangOpts().HLSL &&
+ getLangOpts().getHLS
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr {
let LangOpts = [HLSL];
let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>];
let Documentation = [HLSLResourceBindingDocs];
+ let AdditionalMembers = [{
+ enum class RegisterType : unsigned
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr {
let LangOpts = [HLSL];
let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>];
let Documentation = [HLSLResourceBindingDocs];
+ let AdditionalMembers = [{
+ enum class RegisterType : unsigned
@@ -83,6 +81,49 @@ static RegisterType getRegisterType(StringRef Slot) {
}
}
+static ResourceClass getResourceClass(RegisterType RT) {
+ switch (RT) {
+ case RegisterType::SRV:
+return ResourceClass::SRV;
+ case RegisterType::UAV:
+return ResourceClass::UAV;
+ ca
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr {
let LangOpts = [HLSL];
let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>];
let Documentation = [HLSLResourceBindingDocs];
+ let AdditionalMembers = [{
+ enum class RegisterType : unsigned
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/111203
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr {
let LangOpts = [HLSL];
let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>];
let Documentation = [HLSLResourceBindingDocs];
+ let AdditionalMembers = [{
+ enum class RegisterType : unsigned
@@ -83,6 +81,49 @@ static RegisterType getRegisterType(StringRef Slot) {
}
}
+static ResourceClass getResourceClass(RegisterType RT) {
+ switch (RT) {
+ case RegisterType::SRV:
+return ResourceClass::SRV;
+ case RegisterType::UAV:
+return ResourceClass::UAV;
+ ca
https://github.com/damyanp commented:
I've looked through some of this and added some comments. I called out one
place where there's some missing `const`s on members, but I think in general
the code is not const correct and I didn't call out all the spots that I saw.
I have to admit I'm pretty
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr {
let LangOpts = [HLSL];
let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>];
let Documentation = [HLSLResourceBindingDocs];
+ let AdditionalMembers = [{
+ enum class RegisterType : unsigned
@@ -4593,6 +4593,44 @@ def HLSLResourceBinding: InheritableAttr {
let LangOpts = [HLSL];
let Args = [StringArgument<"Slot">, StringArgument<"Space", 1>];
let Documentation = [HLSLResourceBindingDocs];
+ let AdditionalMembers = [{
+ enum class RegisterType : unsigned
@@ -28,13 +28,62 @@ class AttributeCommonInfo;
class IdentifierInfo;
class ParsedAttr;
class Scope;
+class VarDecl;
+
+using llvm::dxil::ResourceClass;
// FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no
// longer need to create builtin buffer types
@@ -489,3 +494,100 @@ void CGHLSLRuntime::generateGlobalCtorDtorCalls() {
GV->eraseFromParent();
}
}
+
+// Returns handle type of a resource, if the type is a resource
+// or an array of resources
+static const HLSLAttributedResourceType *findHandleTypeOnResource(QualTy
@@ -489,3 +494,100 @@ void CGHLSLRuntime::generateGlobalCtorDtorCalls() {
GV->eraseFromParent();
}
}
+
+// Returns handle type of a resource, if the type is a resource
+// or an array of resources
+static const HLSLAttributedResourceType *findHandleTypeOnResource(QualTy
@@ -1121,6 +1121,11 @@
CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn,
if (Decls[i])
EmitRuntimeCall(Decls[i]);
+if (getLangOpts().HLSL)
+ if (llvm::Function *ResInitFn =
+ CGM.getHLSLRuntime().createResourceBindingInitFn())
@@ -5622,6 +5622,9 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl
*D,
getCUDARuntime().handleVarRegistration(D, *GV);
}
+ if (LangOpts.HLSL)
+getHLSLRuntime().handleGlobalVarDefinition(D, GV);
damyanp wrote:
Just checking you know th
damyanp wrote:
> Hey Damyan, GH suggested you as a reviewer for this. Would you be able to
> TAL? Happy to find someone else if not :)
I'm not sure why GH would have done that, I'm afraid I wouldn't be able to give
an informed review here. (I might have a quick look anyway).
https://github.co
@@ -1121,6 +1121,11 @@
CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn,
if (Decls[i])
EmitRuntimeCall(Decls[i]);
+if (getLangOpts().HLSL)
+ if (llvm::Function *ResInitFn =
+ CGM.getHLSLRuntime().createResourceBindingInitFn())
https://github.com/damyanp commented:
LGTM. Would be good to get review from someone more familiar with ASTs and
external sema source.
https://github.com/llvm/llvm-project/pull/112600
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lis
@@ -483,10 +573,103 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *getSizeOfLEQ16Expr(clang::ASTContext &context,
+ SourceLocation NameLoc,
+
@@ -483,10 +573,103 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *getSizeOfLEQ16Expr(clang::ASTContext &context,
damyanp wrote:
```suggestion
BinaryOperator *getSi
@@ -323,30 +324,99 @@ struct TemplateParameterListBuilder {
S.Context, Builder.Record->getDeclContext(), SourceLocation(),
SourceLocation(), /* TemplateDepth */ 0, Position,
&S.Context.Idents.get(Name, tok::TokenKind::identifier),
-/* Typename */
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/112600
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,64 +1,64 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump
-DEMPTY %s | FileCheck -check-prefix=EMPTY %s
damyanp wrote:
We should try to fix this before completing the PR.
https://github.com/llvm/llvm-project/pull/112600
@@ -483,10 +573,103 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *getSizeOfLEQ16Expr(clang::ASTContext &context,
+ SourceLocation NameLoc,
+
@@ -323,30 +324,99 @@ struct TemplateParameterListBuilder {
S.Context, Builder.Record->getDeclContext(), SourceLocation(),
SourceLocation(), /* TemplateDepth */ 0, Position,
&S.Context.Idents.get(Name, tok::TokenKind::identifier),
-/* Typename */
@@ -483,10 +573,103 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *getSizeOfLEQ16Expr(clang::ASTContext &context,
+ SourceLocation NameLoc,
+
https://github.com/damyanp commented:
Some more notes
https://github.com/llvm/llvm-project/pull/112600
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -323,30 +324,119 @@ struct TemplateParameterListBuilder {
S.Context, Builder.Record->getDeclContext(), SourceLocation(),
SourceLocation(), /* TemplateDepth */ 0, Position,
&S.Context.Idents.get(Name, tok::TokenKind::identifier),
-/* Typename *
@@ -28,13 +28,60 @@ class AttributeCommonInfo;
class IdentifierInfo;
class ParsedAttr;
class Scope;
+class VarDecl;
+
+using llvm::dxil::ResourceClass;
// FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no
// longer need to create builtin buffer types
@@ -985,88 +1034,85 @@ SemaHLSL::TakeLocForHLSLAttribute(const
HLSLAttributedResourceType *RT) {
return LocInfo;
}
-// get the record decl from a var decl that we expect
-// represents a resource
-static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) {
- const Type *
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/111203
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp approved this pull request.
Some comments added, but I think we're probably good to go here.
https://github.com/llvm/llvm-project/pull/111203
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-
@@ -985,88 +1034,85 @@ SemaHLSL::TakeLocForHLSLAttribute(const
HLSLAttributedResourceType *RT) {
return LocInfo;
}
-// get the record decl from a var decl that we expect
-// represents a resource
-static CXXRecordDecl *getRecordDeclFromVarDecl(VarDecl *VD) {
- const Type *
@@ -110,6 +110,19 @@ DeclBindingInfo
*ResourceBindings::addDeclBindingInfo(const VarDecl *VD,
ResourceClass ResClass) {
assert(getDeclBindingInfo(VD, ResClass) == nullptr &&
"DeclBindingInfo already added");
+#if
@@ -28,13 +28,60 @@ class AttributeCommonInfo;
class IdentifierInfo;
class ParsedAttr;
class Scope;
+class VarDecl;
+
+using llvm::dxil::ResourceClass;
// FIXME: This can be hidden (as static function in SemaHLSL.cpp) once we no
// longer need to create builtin buffer types
301 - 400 of 499 matches
Mail list logo