[clang] [llvm] [HLSL] Emit a version in the dx.rootsignatures metadata (PR #145113)

2025-06-20 Thread Justin Bogner via cfe-commits
https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/145113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add `hlsl-rootsig-ver` option to specify root signature version (PR #144813)

2025-06-20 Thread Justin Bogner via cfe-commits
@@ -9288,6 +9288,23 @@ def fcgl : DXCFlag<"fcgl">, Alias; def enable_16bit_types : DXCFlag<"enable-16bit-types">, Alias, HelpText<"Enable 16-bit types and disable min precision types." "Available in HLSL 2018 and shader model 6.2.">; +def hlsl_rootsig_ver : + Opt

[clang] [llvm] [HLSL][RootSignature] Add `hlsl-rootsig-ver` option to specify root signature version (PR #144813)

2025-06-19 Thread Justin Bogner via cfe-commits
@@ -99,6 +99,12 @@ enum class SamplerFeedbackType : uint32_t { const unsigned MinWaveSize = 4; const unsigned MaxWaveSize = 128; +// D3D_ROOT_SIGNATURE_VERSION +enum class RootSignatureVersion { + rootsig_1_0 = 0x1, + rootsig_1_1 = 0x2, +}; bogner wrote: Sh

[clang] [llvm] [HLSL][RootSignature] Add `hlsl-rootsig-ver` option to specify root signature version (PR #144813)

2025-06-19 Thread Justin Bogner via cfe-commits
@@ -5179,6 +5179,8 @@ class HLSLRootSignatureDecl final llvm::hlsl::rootsig::RootElement> { friend TrailingObjects; + llvm::dxil::RootSignatureVersion RootSigVer; bogner wrote: This is a member of a HLSLRootSignatureDecl

[clang] [llvm] [HLSL][RootSignature] Add `hlsl-rootsig-ver` option to specify root signature version (PR #144813)

2025-06-19 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: The implementation all looks fairly straightforward here, but shouldn't we be naming the `clang-dxc` flag to match `dxc`'s flag that does this? That is, `-force-rootsig-ver`. https://github.com/llvm/llvm-project/pull/144813 _

[clang] [llvm] [HLSL][RootSignature] Add `hlsl-rootsig-ver` option to specify root signature version (PR #144813)

2025-06-19 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/144813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Implement validation of resource ranges for `RootDescriptors` (PR #140962)

2025-06-19 Thread Justin Bogner via cfe-commits
@@ -1068,10 +1069,139 @@ void SemaHLSL::ActOnFinishRootSignatureDecl( SemaRef.getASTContext(), /*DeclContext=*/SemaRef.CurContext, Loc, DeclIdent, Elements); + // Perform validation of constructs here bogner wrote: I don't think this comment is h

[clang] [llvm] [HLSL][RootSignature] Implement validation of resource ranges for `RootDescriptors` (PR #140962)

2025-06-19 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - %s -verify + +#define Overlap0 "CBV(b42), CBV(b42)" + +[RootSignature(Overlap0)] // expected-error {{resource ranges b[42;42] and b[42;42] overlap within space = 0 and visibility = All}} ---

[clang] [llvm] [HLSL][RootSignature] Implement validation of resource ranges for `RootDescriptors` (PR #140962)

2025-06-19 Thread Justin Bogner via cfe-commits
@@ -71,13 +71,17 @@ class MetadataBuilder { SmallVector GeneratedMetadata; }; -// RangeInfo holds the information to correctly construct a ResourceRange -// and retains this information to be used for displaying a better diagnostic struct RangeInfo { - const static uint32_

[clang] [llvm] [HLSL][RootSignature] Implement validation of resource ranges for `RootDescriptors` (PR #140962)

2025-06-19 Thread Justin Bogner via cfe-commits
@@ -1068,10 +1069,139 @@ void SemaHLSL::ActOnFinishRootSignatureDecl( SemaRef.getASTContext(), /*DeclContext=*/SemaRef.CurContext, Loc, DeclIdent, Elements); + // Perform validation of constructs here + if (handleRootSignatureDecl(SignatureDecl, Loc)) +return

[clang] [llvm] [HLSL][RootSignature] Implement validation of resource ranges for `RootDescriptors` (PR #140962)

2025-06-19 Thread Justin Bogner via cfe-commits
@@ -71,13 +71,17 @@ class MetadataBuilder { SmallVector GeneratedMetadata; }; -// RangeInfo holds the information to correctly construct a ResourceRange -// and retains this information to be used for displaying a better diagnostic struct RangeInfo { - const static uint32_

[clang] [llvm] [HLSL][RootSignature] Implement validation of resource ranges for `RootDescriptors` (PR #140962)

2025-06-19 Thread Justin Bogner via cfe-commits
@@ -1068,10 +1069,139 @@ void SemaHLSL::ActOnFinishRootSignatureDecl( SemaRef.getASTContext(), /*DeclContext=*/SemaRef.CurContext, Loc, DeclIdent, Elements); + // Perform validation of constructs here + if (handleRootSignatureDecl(SignatureDecl, Loc)) +return

[clang] [llvm] [HLSL][RootSignature] Implement validation of resource ranges for `RootDescriptors` (PR #140962)

2025-06-19 Thread Justin Bogner via cfe-commits
@@ -1068,10 +1069,139 @@ void SemaHLSL::ActOnFinishRootSignatureDecl( SemaRef.getASTContext(), /*DeclContext=*/SemaRef.CurContext, Loc, DeclIdent, Elements); + // Perform validation of constructs here + if (handleRootSignatureDecl(SignatureDecl, Loc)) +return

[clang] [llvm] [HLSL][RootSignature] Implement validation of resource ranges for `RootDescriptors` (PR #140962)

2025-06-19 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: Looks pretty good. Mostly stylistic comments. https://github.com/llvm/llvm-project/pull/140962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Implement validation of resource ranges for `RootDescriptors` (PR #140962)

2025-06-19 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/140962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Implement validation of resource ranges for `RootDescriptors` (PR #140962)

2025-06-19 Thread Justin Bogner via cfe-commits
@@ -1068,10 +1069,139 @@ void SemaHLSL::ActOnFinishRootSignatureDecl( SemaRef.getASTContext(), /*DeclContext=*/SemaRef.CurContext, Loc, DeclIdent, Elements); + // Perform validation of constructs here + if (handleRootSignatureDecl(SignatureDecl, Loc)) +return

[clang] [llvm] [HLSL] Use hidden visibility for external linkage. (PR #140292)

2025-06-16 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/140292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPIRV] Use resource names (PR #143412)

2025-06-10 Thread Justin Bogner via cfe-commits
@@ -243,7 +243,7 @@ CGHLSLRuntime::getCreateHandleFromBindingIntrinsic() { case llvm::Triple::dxil: return std::pair(llvm::Intrinsic::dx_resource_handlefrombinding, true); case llvm::Triple::spirv: -return std::pair(llvm::Intrinsic::spv_resource_handlefrombinding, f

[clang] [llvm] [HLSL][SPIRV] Use resource names (PR #143412)

2025-06-10 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/143412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC][HLSL][DXIL] Move D3D12.h enums and flags to DXILABI (PR #143041)

2025-06-10 Thread Justin Bogner via cfe-commits
https://github.com/bogner requested changes to this pull request. https://github.com/llvm/llvm-project/pull/143041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC][HLSL][DXIL] Move D3D12.h enums and flags to DXILABI (PR #143041)

2025-06-10 Thread Justin Bogner via cfe-commits
@@ -99,6 +99,128 @@ enum class SamplerFeedbackType : uint32_t { const unsigned MinWaveSize = 4; const unsigned MaxWaveSize = 128; +// Definition of the various d3d12.h enumerations and flags. The definitions of +// all values here correspond to their description in the d3d12.h

[clang-tools-extra] [clangd] [Modules] Fix to correctly handle module dependencies (PR #142828)

2025-06-10 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,96 @@ +# A smoke test to check that a simple dependency chain for modules can work. +# +# FIXME: This fails on the Windows ARM64 build server. Not entirely sure why as it has been tested on +#an ARM64 Windows VM and appears to work there. +# UNSUPPORTED: host=a

[clang-tools-extra] [clangd] [Modules] Fix to correctly handle module dependencies (PR #142828)

2025-06-09 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,96 @@ +# A smoke test to check that a simple dependency chain for modules can work. +# +# FIXME: This fails on the Windows ARM64 build server. Not entirely sure why as it has been tested on +#an ARM64 Windows VM and appears to work there. +# UNSUPPORTED: host=a

[clang] [llvm] [NFC][HLSL][DXIL] Move D3D12.h enums and flags to DXILABI (PR #143041)

2025-06-06 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. This makes sense to me. As a follow up, we should look into whether BinaryFormat/DXContainer.h can get some of these enum values from here rather than duplicating their values. https://github.com/llvm/llvm-project/pull/143041 __

[clang] [llvm] [NFC][HLSL][DXIL] Move D3D12.h enums and flags to DXILABI (PR #143041)

2025-06-06 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/143041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC][HLSL][DXIL] Move D3D12.h enums and flags to DXILABI (PR #143041)

2025-06-06 Thread Justin Bogner via cfe-commits
@@ -99,6 +99,132 @@ enum class SamplerFeedbackType : uint32_t { const unsigned MinWaveSize = 4; const unsigned MaxWaveSize = 128; +// Definition of the various d3d12.h enumerations and flags. The definitions of +// all values here correspond to their description in the d3d12.h

[clang] [llvm] [HLSL][SPIR-V] Implement vk::ext_builtin_input attribute (PR #138530)

2025-06-03 Thread Justin Bogner via 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?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: @@ -554,6 +554,19 @@ static void initializeBufferFromBinding(CodeGenModule &CGM,

[clang] [llvm] [HLSL][SPIR-V] Implement vk::ext_builtin_input attribute (PR #138530)

2025-06-03 Thread Justin Bogner via 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?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: @@ -140,6 +140,11 @@ def SharedVar : SubsetSubjecthasGlobalStorage() && !S->getTLSKind()}],

[clang] [llvm] [HLSL][SPIR-V] Implement vk::ext_builtin_input attribute (PR #138530)

2025-06-03 Thread Justin Bogner via cfe-commits
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?= , Nathan =?utf-8?q?Gau=C3=ABr?= Message-ID: In-Reply-To: https://github.com/bogner approved this pull request. https://github.com/llvm/

[clang] [llvm] [HLSL][RootSignature] Metadata generation of RootFlags, RootConstants, RootDescriptors (PR #142010)

2025-05-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/142010 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add parsing of floats for StaticSampler (PR #140181)

2025-05-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/140181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make implicit binding warning off by default (PR #141879)

2025-05-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. We don't technically need to remove the `-Wno-implicit-binding` from the tests, but I suppose you did the work anyway and it doesn't hurt. https://github.com/llvm/llvm-project/pull/141879 ___ cfe-c

[clang] [HLSL] Add Buffer def to frontend (PR #141086)

2025-05-27 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. Looks good (noting that we're matching the pre-existing buggy behaviour of StructuredBuffer and will follow up to fix that for both) https://github.com/llvm/llvm-project/pull/141086 ___ cfe-commits

[clang] [llvm] [DirectX] Add resource name argument to llvm.dx.handlefrom[implicit]binding intrinsics (PR #139991)

2025-05-27 Thread Justin Bogner via cfe-commits
@@ -557,29 +553,47 @@ static void initializeBuffer(CodeGenModule &CGM, llvm::GlobalVariable *GV, CGM.AddCXXGlobalInit(InitResFunc); } -static void initializeBufferFromBinding(CodeGenModule &CGM, -llvm::GlobalVariable *GV, -

[clang] [llvm] [DirectX] Add resource name argument to llvm.dx.handlefrom[implicit]binding intrinsics (PR #139991)

2025-05-27 Thread Justin Bogner via cfe-commits
@@ -557,29 +553,47 @@ static void initializeBuffer(CodeGenModule &CGM, llvm::GlobalVariable *GV, CGM.AddCXXGlobalInit(InitResFunc); } -static void initializeBufferFromBinding(CodeGenModule &CGM, -llvm::GlobalVariable *GV, -

[clang] [llvm] [DirectX] Add resource name argument to llvm.dx.handlefrom[implicit]binding intrinsics (PR #139991)

2025-05-27 Thread Justin Bogner via cfe-commits
@@ -299,9 +299,20 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, // (llvm/llvm-project#135452) Value *NonUniform = llvm::ConstantInt::get(llvm::Type::getInt1Ty(getLLVMContext()), false); -return Builder.CreateIntrinsic( -HandleTy

[clang] [HLSL] Add resource name argument to resource class constructors (PR #139985)

2025-05-27 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/139985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add parsing of Register in params for RootDescriptors (PR #140148)

2025-05-22 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. Looks basically good. A question about test coverage below. https://github.com/llvm/llvm-project/pull/140148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [llvm] [HLSL][RootSignature] Add parsing of Register in params for RootDescriptors (PR #140148)

2025-05-22 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/140148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add parsing of Register in params for RootDescriptors (PR #140148)

2025-05-22 Thread Justin Bogner via cfe-commits
@@ -346,9 +346,9 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootFlagsTest) { TEST_F(ParseHLSLRootSignatureTest, ValidParseRootDescriptorsTest) { const llvm::StringLiteral Source = R"cc( -CBV(), -SRV(), -UAV() bogner wrote: Do we have a tes

[clang] [HLSL] Add Buffer def to frontend (PR #141086)

2025-05-22 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: We should also add AST tests in clang/test/AST/HLSL/TypedBuffers-AST.hlsl https://github.com/llvm/llvm-project/pull/141086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [llvm] [DirectX][SPIRV] Fix the lowering of dot4add (PR #140315)

2025-05-17 Thread Justin Bogner via cfe-commits
https://github.com/bogner closed 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

[clang] [llvm] [DirectX][SPIRV] Fix the lowering of dot4add (PR #140315)

2025-05-17 Thread Justin Bogner via cfe-commits
@@ -1,17 +1,19 @@ -// RUN: %clang_cc1 -finclude-default-header -triple \ -// RUN: dxil-pc-shadermodel6.3-compute %s -emit-llvm -disable-llvm-passes -o - | \ -// RUN: FileCheck %s -DTARGET=dx -// RUN: %clang_cc1 -finclude-default-header -triple \ -// RUN: spirv-pc-vulkan-com

[clang] [llvm] [DirectX][SPIRV] Fix the lowering of dot4add (PR #140315)

2025-05-17 Thread Justin Bogner via cfe-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/140315 >From e4d7bfd8226d730fc8c12e5af765f22069a0d8bf Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Wed, 7 May 2025 16:11:28 -0700 Subject: [PATCH 1/2] [DirectX][SPIRV] Fix the lowering of dot4add There were s

[clang] [llvm] [DirectX][SPIRV] Fix the lowering of dot4add (PR #140315)

2025-05-16 Thread Justin Bogner via cfe-commits
@@ -1,17 +1,19 @@ -// RUN: %clang_cc1 -finclude-default-header -triple \ -// RUN: dxil-pc-shadermodel6.3-compute %s -emit-llvm -disable-llvm-passes -o - | \ -// RUN: FileCheck %s -DTARGET=dx -// RUN: %clang_cc1 -finclude-default-header -triple \ -// RUN: spirv-pc-vulkan-com

[clang] [llvm] [DirectX][SPIRV] Fix the lowering of dot4add (PR #140315)

2025-05-16 Thread Justin Bogner via cfe-commits
018 >From e4d7bfd8226d730fc8c12e5af765f22069a0d8bf Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Wed, 7 May 2025 16:11:28 -0700 Subject: [PATCH] [DirectX][SPIRV] Fix the lowering of dot4add There were some issues with these ops: - The overload wasn't being specified (`dx.op

[clang] [clang] Emit convergence tokens for loop in global array init (PR #140120)

2025-05-15 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/140120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add metadata generation for descriptor tables (PR #139633)

2025-05-15 Thread Justin Bogner via cfe-commits
@@ -423,6 +437,14 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD, // FIXME: Handle codegen for return type semantics. // See: https://github.com/llvm/llvm-project/issues/57875 B.CreateRetVoid(); + + // Add and identify root signature to function, if app

[clang] [llvm] [HLSL][RootSignature] Add metadata generation for descriptor tables (PR #139633)

2025-05-15 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. Looks good. A couple of style nitpicks. https://github.com/llvm/llvm-project/pull/139633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [llvm] [HLSL][RootSignature] Add metadata generation for descriptor tables (PR #139633)

2025-05-15 Thread Justin Bogner via cfe-commits
@@ -160,6 +163,65 @@ void dumpRootElements(raw_ostream &OS, ArrayRef Elements) { OS << "}"; } +MDNode *MetadataBuilder::BuildRootSignature() { + for (const RootElement &Element : Elements) { +MDNode *ElementMD = nullptr; +if (const auto &Clause = std::get_if(&Eleme

[clang] [llvm] [HLSL][RootSignature] Add metadata generation for descriptor tables (PR #139633)

2025-05-15 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/139633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Update Sema Checking Diagnostics for builtins (PR #138429)

2025-05-14 Thread Justin Bogner via cfe-commits
https://github.com/bogner 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

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-14 Thread Justin Bogner via cfe-commits
@@ -3296,27 +3312,42 @@ static bool initVarDeclWithCtor(Sema &S, VarDecl *VD, return true; } -static bool initGlobalResourceDecl(Sema &S, VarDecl *VD) { +bool SemaHLSL::initGlobalResourceDecl(VarDecl *VD) { + std::optional RegisterSlot; + uint32_t SpaceNo = 0; HLSLResou

[clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)

2025-05-14 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/138976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Simplify resource constructors codegen tests (PR #139842)

2025-05-14 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/139842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Stricter Overload Tests (clamp, max, min, pow) (PR #138993)

2025-05-07 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/138993 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Rename isImplicit() to hasRegisterStot() on HLSLResourceBindingAttr (PR #138964)

2025-05-07 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/138964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add parsing for empty RootConstants (PR #137999)

2025-05-07 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/137877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/137877 >From a6c359a02712277ba2feab9e2f1be1caf8fa650e Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Tue, 29 Apr 2025 11:59:37 -0700 Subject: [PATCH] [HLSL] Overloads for `lerp` with a scalar weight This a

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/137877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/137898 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/137898 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-30 Thread Justin Bogner via cfe-commits
bogner wrote: > I have a strong suspicion all the `*-overload.hlsl` tests have the same > mistake and are also incorrect and need to updated. Can you file a ticket for > investigating\cleaning up the other overload tests. Not work you have to do, > but we should at least track that it needs ot

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-30 Thread Justin Bogner via cfe-commits
@@ -1,108 +1,160 @@ -// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK \ -// RUN: -DFNATTRS="noundef nofpclass(nan inf)"

[clang] [HLSL][SPIRV] Add CLI option `-fspv-extension` (PR #137985)

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/137898 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -1,108 +1,160 @@ -// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK \ -// RUN: -DFNATTRS="noundef nofpclass(nan inf)"

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -106,3 +102,17 @@ float3 test_lerp_uint64_t3(uint64_t3 p0) { return lerp(p0, p0, p0); } // CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}) // CHECK: ret <4 x floa

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-29 Thread Justin Bogner via cfe-commits
actually look at the whole function. Note - this would be simpler with update_cc_test_checks, but the differences between DX and SPIRV are difficult to account for with those scripts. >From 2c9a706a1cbd418ff4116a6f118a56a588f91a7e Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Tue, 29

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -106,3 +102,17 @@ float3 test_lerp_uint64_t3(uint64_t3 p0) { return lerp(p0, p0, p0); } // CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}) // CHECK: ret <4 x floa

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -277,6 +277,12 @@ constexpr bool4 isinf(double4 V) { return isinf((float4)V); } // lerp builtins overloads //===--===// +template +constexpr __detail::enable_if_t<(N > 1 && N <= 4), vector> -

[clang] [HLSL][RootSignature] Add lexing support for floating points (PR #137720)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137720 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -5209,6 +5211,92 @@ void Parser::ParseMicrosoftUuidAttributeArgs(ParsedAttributes &Attrs) { } } +void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) { + assert(Tok.is(tok::identifier) && "Not a Microsoft attribute list"); + IdentifierInfo *R

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -5209,6 +5211,92 @@ void Parser::ParseMicrosoftUuidAttributeArgs(ParsedAttributes &Attrs) { } } +void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) { + assert(Tok.is(tok::identifier) && "Not a Microsoft attribute list"); + IdentifierInfo *R

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -5209,6 +5211,92 @@ void Parser::ParseMicrosoftUuidAttributeArgs(ParsedAttributes &Attrs) { } } +void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) { + assert(Tok.is(tok::identifier) && "Not a Microsoft attribute list"); + IdentifierInfo *R

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/137690 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: A couple of minor comments. The direction seems reasonable to me, but it'd be good to get someone more familiar with the Parser and AST to weigh in. https://github.com/llvm/llvm-project/pull/137690 ___ cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. 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

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-29 Thread Justin Bogner via cfe-commits
00:00:00 2001 From: Justin Bogner Date: Tue, 29 Apr 2025 11:59:37 -0700 Subject: [PATCH] [HLSL] Overloads for `lerp` with a scalar weight This adds overloads for the `lerp` function that accept a scalar for the weight parameter by splatting it into the appropriate vector. Fixes #137827 --- .../

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -1,34 +1,117 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL +// RUN: %clang_cc1 -Wno-hlsl-implicit-binding -triple dxil-pc-shadermodel6.3-library -emit-llvm -disabl

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: A minor comment on naming of the builtins but this generally looks good https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -4801,6 +4801,18 @@ def HLSLResourceGetPointer : LangBuiltin<"HLSL_LANG"> { let Prototype = "void(...)"; } +def HLSLResourceCreatePoisonHandle : LangBuiltin<"HLSL_LANG"> { + let Spellings = ["__builtin_hlsl_resource_createpoisonhandle"]; + let Attributes = [NoThrow]; +

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner 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

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -189,6 +201,9 @@ class DXILPrepareModule : public ModulePass { for (auto &BB : F) { IRBuilder<> Builder(&BB); for (auto &I : make_early_inc_range(BB)) { + + I.dropUnknownNonDebugMetadata(DXILCompatibleMDs); + if (I.getOpcode() == Ins

[clang] [HLSL] Put tests for compatibility overloads for 'clamp', 'isinf', 'min', and 'max' in own files (PR #137004)

2025-04-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137004 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,29 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; Test that only metadata nodes that are valid in DXIL are allowed through + +target triple = "dxilv1.0-unknown-shadermodel6.0-compute" + +; Function Attrs: noinline nounwind memory(readwrite, inaccessiblemem: non

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -176,6 +185,9 @@ class DXILPrepareModule : public ModulePass { VersionTuple ValVer = MetadataInfo.ValidatorVersion; bool SkipValidation = ValVer.getMajor() == 0 && ValVer.getMinor() == 0; +// construct whitelist of valid metadata node kinds bogn

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,29 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; Test that only metadata nodes that are valid in DXIL are allowed through + +target triple = "dxilv1.0-unknown-shadermodel6.0-compute" + +; Function Attrs: noinline nounwind memory(readwrite, inaccessiblemem: non

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,29 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; Test that only metadata nodes that are valid in DXIL are allowed through + +target triple = "dxilv1.0-unknown-shadermodel6.0-compute" + +; Function Attrs: noinline nounwind memory(readwrite, inaccessiblemem: non

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/136386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. Looks good https://github.com/llvm/llvm-project/pull/136386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Allow non `.hlsl` files as source files (PR #137378)

2025-04-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,39 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; This test tests the whitelist inside of DxilPrepare.cpp. +; It ensures that certain metadata nodes are removed that aren't +; in the whitelist, and that certain nodes may remain that +; are on the whitelist. + +

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-25 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: Description / commit message needs to be updated to match how this ended up, but otherwise this is looking pretty good. A couple of minor comments inline. https://github.com/llvm/llvm-project/pull/136386 ___ cfe-co

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,39 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; This test tests the whitelist inside of DxilPrepare.cpp. +; It ensures that certain metadata nodes are removed that aren't +; in the whitelist, and that certain nodes may remain that +; are on the whitelist. + +

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,39 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; This test tests the whitelist inside of DxilPrepare.cpp. +; It ensures that certain metadata nodes are removed that aren't +; in the whitelist, and that certain nodes may remain that +; are on the whitelist. ---

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-25 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/136386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Treat classes and structs as packed by default (PR #137391)

2025-04-25 Thread Justin Bogner via cfe-commits
bogner wrote: > Are there offload test suite tests to go with this? https://github.com/llvm-beanz/offload-test-suite/pull/83 https://github.com/llvm/llvm-project/pull/137391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,80 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +source_filename = "C:\\Users\\jbatista\\Desktop\\particle_life.hlsl" +target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" +target triple = "dxilv1.0-unknown-shader

  1   2   3   4   5   6   7   8   9   10   >