https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/135120
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -89,12 +89,51 @@ RESOURCE Buffer;
// CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]]
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]]
+// Default constructor
+
+// CHECK: CXXConstructorDecl {{.*}} [[RESOURCE]] 'void ()' inline
+// CHECK-NEXT: CompoundStmt
+// CHECK-
https://github.com/damyanp commented:
LGTM
https://github.com/llvm/llvm-project/pull/135120
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp commented:
Seems reasonable to my untrained eye.
https://github.com/llvm/llvm-project/pull/131384
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -35,6 +35,12 @@ length_vec_impl(vector X) {
#endif
}
+template
+constexpr vector dst_impl(vector src0, vector src1) {
+ vector dest = {1, src0[1] * src1[1], src0[2], src1[3]};
+ return dest;
+}
damyanp wrote:
It looks like this needs to be done across m
@@ -35,6 +35,12 @@ length_vec_impl(vector X) {
#endif
}
+template
+constexpr vector dst_impl(vector src0, vector src1) {
+ vector dest = {1, src0[1] * src1[1], src0[2], src1[3]};
+ return dest;
+}
damyanp wrote:
Coding conventions:
```suggestion
constexpr
https://github.com/damyanp commented:
LGTM, but probably need someone with more area expertise than me to approve it.
https://github.com/llvm/llvm-project/pull/132828
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bi
https://github.com/damyanp commented:
Are there any error conditions that need testing as well?
https://github.com/llvm/llvm-project/pull/129334
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe
https://github.com/damyanp commented:
Thanks for the updates.
Please be sure to tag the issue that this is addressing in the PR description
(something like "Closes #".) Or at least make sure that it is linked in the
"Development" section.
I won't be clicking Approve because we need approv
@@ -290,6 +290,24 @@ _HLSL_BUILTIN_ALIAS(__builtin_hlsl_and)
bool4 and(bool4 x, bool4 y);
// clang-format on
+//===--===//
+// or builtins
+//===
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/128979
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/128979
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/128979
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2305,6 +2305,25 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
TheCall->setType(ArgTyA);
break;
}
+ case Builtin::BI__builtin_hlsl_or: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElem
https://github.com/damyanp commented:
Please be sure to tag the issue that this is addressing in the PR description
(something like "Closes #".) Or at least make sure that it is linked in
the "Development" section.
(Oops, I had two tabs open and confused github and myself)
https://github
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/128979
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,85 @@
+// RUN: %clang_cc1 -finclude-default-header -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s \
+// RUN: -emit-llvm -O1 -o - | FileCheck %s
+
+//CHECK-LABEL: define noundef i1 @_Z12test_or_boolbb(
+//CHECK-SAME: i1 noundef [[X:%.*]], i1 noundef [[Y:%.*]])
@@ -290,6 +290,24 @@ _HLSL_BUILTIN_ALIAS(__builtin_hlsl_and)
bool4 and(bool4 x, bool4 y);
// clang-format on
+//===--===//
+// or builtins
+//===
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -verify -DTEST_FUNC=__builtin_hlsl_or
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -verify -DTEST_FUNC=__builtin_hlsl_and
---
@@ -2305,6 +2305,25 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
TheCall->setType(ArgTyA);
break;
}
+ case Builtin::BI__builtin_hlsl_or: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElem
@@ -290,6 +290,24 @@ _HLSL_BUILTIN_ALIAS(__builtin_hlsl_and)
bool4 and(bool4 x, bool4 y);
// clang-format on
+//===--===//
+// or builtins
+//===
https://github.com/damyanp commented:
Congrats on getting your first change in! Some notes, mainly around comments,
although we probably also want to fix the clang-format issue (if there is one).
https://github.com/llvm/llvm-project/pull/128979
___
c
https://github.com/damyanp approved this pull request.
https://github.com/llvm/llvm-project/pull/128257
___
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 from a code perspective. If you're confident that it's the right thing to
do then yay!
https://github.com/llvm/llvm-project/pull/126561
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.ll
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/122981
___
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 - I'm surprised we don't have all of the tokens we're going to need for
root signatures included in this PR.
https://github.com/llvm/llvm-project/pull/122981
___
cfe-commits mailing list
cfe-commits@lists.llv
@@ -0,0 +1,171 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace clang {
+namespace hlsl {
+
+// Lexer Definitions
+
+static bool IsNumberChar(char C) {
+ // TODO(#120472): extend for float support exponents
damyanp wrote:
The issue linked here (#
https://github.com/damyanp commented:
LGTM as a reland.
https://github.com/llvm/llvm-project/pull/126258
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,134 @@
+//=== ParseHLSLRootSignatureTest.cpp - Parse Root Signature tests
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
https://github.com/damyanp approved this pull request.
Does this fix a test failure?
https://github.com/llvm/llvm-project/pull/122337
___
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/119444
___
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/damyanp commented:
LGTM - a nit and an idea in the comments.
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
https://github.com/damyanp edited
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
@@ -656,18 +670,20 @@
BuiltinTypeDeclBuilder::addSimpleTemplateParams(ArrayRef Names,
}
BuiltinTypeDeclBuilder &BuiltinTypeDeclBuilder::addIncrementCounterMethod() {
+ using PH = BuiltinTypeMethodBuilder::PlaceHolder;
return BuiltinTypeMethodBuilder(SemaRef, *this, "Incre
@@ -853,6 +853,45 @@ float3 degrees(float3);
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_degrees)
float4 degrees(float4);
+//===--===//
+// distance builtins
+//===--
damyanp wrote:
@bob80905 - can you associate this with an issue please?
https://github.com/llvm/llvm-project/pull/116413
___
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/116413
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp commented:
This LGTM, but I think we should try and get reviews from @tex3d and
@llvm-beanz before completing this PR.
https://github.com/llvm/llvm-project/pull/115911
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm
-finclude-default-header -disable-llvm-passes -o - %s | FileCheck %s
+
+// Make sure SV_GroupID translated into dx.group.id.
+
+// CHECK: define void @foo()
+// CHECK: %[[#ID:]] = cal
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
@@ -323,30 +324,127 @@ struct TemplateParameterListBuilder {
S.Context, Builder.Record->getDeclContext(), SourceLocation(),
SourceLocation(), /* TemplateDepth */ 0, Position,
&S.Context.Idents.get(Name, tok::TokenKind::identifier),
-/* Typename *
@@ -323,30 +324,127 @@ struct TemplateParameterListBuilder {
S.Context, Builder.Record->getDeclContext(), SourceLocation(),
SourceLocation(), /* TemplateDepth */ 0, Position,
&S.Context.Idents.get(Name, tok::TokenKind::identifier),
-/* Typename *
@@ -323,30 +324,127 @@ 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 commented:
Some notes, mostly about the comments.
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,127 @@ struct TemplateParameterListBuilder {
S.Context, Builder.Record->getDeclContext(), SourceLocation(),
SourceLocation(), /* TemplateDepth */ 0, Position,
&S.Context.Idents.get(Name, tok::TokenKind::identifier),
-/* Typename *
@@ -4,21 +4,30 @@
// NOTE: SPIRV codegen for resource types is not yet implemented
StructuredBuffer Buf : register(t10);
+RWStructuredBuffer Buf2 : register(u5, space1);
// CHECK: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer",
float, 0, 0), float }
+// CHE
@@ -0,0 +1,70 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute
-finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s
+
+// NOTE: The number in type name and whether the struct is packed or not will
mostly
+// likely change once subscript oper
https://github.com/damyanp commented:
LGTM
https://github.com/llvm/llvm-project/pull/113206
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5030,6 +5030,29 @@ bool Type::hasSizedVLAType() const {
return false;
}
+bool Type::isHLSLIntangibleType() const {
+ const Type *Ty = getUnqualifiedDesugaredType();
+
+ // check if it's a builtin type first (simple check, no need to cache it)
damyanp w
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,
+
@@ -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 *
@@ -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
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
@@ -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,
+
@@ -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,
damyanp wrote:
```suggestion
BinaryOperator *getSi
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
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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:
hmmmaybe a line endings change issue on this file? I'm wondering if some
config in the root of this
https://github.com/damyanp commented:
Some comments based on a quick read through:
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
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
@@ -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 */
@@ -1078,10 +1078,10 @@ ConceptDecl *ConceptDecl::Create(ASTContext &C,
DeclContext *DC,
TemplateParameterList *Params,
Expr *ConstraintExpr) {
bool Invalid = AdoptTemplateParameterList(Params, DC);
- auto *T
@@ -483,10 +554,109 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *getSizeOfLEQ16Expr(clang::ASTContext &context,
+ SourceLocation NameLoc,
+
@@ -483,10 +554,109 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *getSizeOfLEQ16Expr(clang::ASTContext &context,
+ SourceLocation NameLoc,
+
https://github.com/damyanp approved this pull request.
https://github.com/llvm/llvm-project/pull/112661
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -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
@@ -110,6 +110,19 @@ DeclBindingInfo
*ResourceBindings::addDeclBindingInfo(const VarDecl *VD,
ResourceClass ResClass) {
assert(getDeclBindingInfo(VD, ResClass) == nullptr &&
"DeclBindingInfo already added");
+#if
@@ -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 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-
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
@@ -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 *
@@ -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
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) {
llvm_unreachable("unexpected ResourceClass value");
}
-static RegisterType getRegisterType(StringRef Slot) {
+// Converts the first letter of string Slot to RegisterType.
+// Returns false if the let
@@ -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
@@ -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
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) {
llvm_unreachable("unexpected ResourceClass value");
}
-static RegisterType getRegisterType(StringRef Slot) {
+// Converts the first letter of string Slot to RegisterType.
+// Returns false if the let
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) {
llvm_unreachable("unexpected ResourceClass value");
}
-static RegisterType getRegisterType(StringRef Slot) {
+// Converts the first letter of string Slot to RegisterType.
+// Returns false if the let
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) {
llvm_unreachable("unexpected ResourceClass value");
}
-static RegisterType getRegisterType(StringRef Slot) {
+// Converts the first letter of string Slot to RegisterType.
+// Returns false if the let
@@ -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
@@ -58,31 +56,82 @@ static RegisterType getRegisterType(ResourceClass RC) {
llvm_unreachable("unexpected ResourceClass value");
}
-static RegisterType getRegisterType(StringRef Slot) {
+// Converts the first letter of string Slot to RegisterType.
+// Returns false if the let
https://github.com/damyanp approved this pull request.
https://github.com/llvm/llvm-project/pull/111207
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5622,6 +5622,9 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl
*D,
getCUDARuntime().handleVarRegistration(D, *GV);
}
+ if (LangOpts.HLSL)
+getHLSLRuntime().handleGlobalVarDefinition(D, GV);
damyanp wrote:
Could someone file the bu
@@ -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
@@ -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())
@@ -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
@@ -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
1 - 100 of 486 matches
Mail list logo