[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add Metadata generation of Root Signatures for Attr (PR #125131)

2025-01-30 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/125131 - Define and implement `MetadataBuilder` in `HLSLRootSignature` - Integrate and invoke the builder in `CGHLSLRuntime.cpp` to generate the Root Signature for any associated entry functions - Add tests to demonstr

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add Metadata generation of Root Signatures for Attr (PR #125131)

2025-01-30 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/125131 >From 96a959b5c1dd4d46b72344902d697a40100d8046 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 29 Jan 2025 19:40:08 + Subject: [PATCH 1/7] add basic empty root signature --- clang/lib/CodeGen/CGHLSL

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-30 Thread Finn Plummer via llvm-branch-commits
@@ -169,5 +220,399 @@ bool RootSignatureLexer::LexToken(RootSignatureToken &Result) { return false; } +// Parser Definitions + +RootSignatureParser::RootSignatureParser( +SmallVector &Elements, +const SmallVector &Tokens, DiagnosticsEngine &Diags) +: Elements(El

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-02-04 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: Okay, sounds good. In that case then we can remove the code that handles got multiple https://github.com/llvm/llvm-project/pull/123147 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llv

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-02-05 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/122982 >From 5ed5fcfebb395cdfe45dc41094e07716d2003d66 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Tue, 28 Jan 2025 17:49:21 + Subject: [PATCH 01/18] [HLSL][RootSignature] Handle an empty root signature - Def

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-02-07 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/123985 >From 05c9523adaf9cc3e1585c02bed036ad83667b722 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 22 Jan 2025 17:53:59 + Subject: [PATCH 1/6] [HLSL] Define the HLSLRootSignature Attr - Defines HLSLRootS

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-02-10 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/122982 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-02-11 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: Rebasing onto the lexer pr api changes of using `ConsumeToken`/`PeekNextToken` instead of pre-allocating the tokens https://github.com/llvm/llvm-project/pull/122982 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add Metadata generation of Root Signatures for Attr (PR #125131)

2025-02-10 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/125131 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-01-30 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/123985 >From 8ecb03776b24247e7c68e12d2d9aea8f26e2e0cc Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 22 Jan 2025 17:53:59 + Subject: [PATCH 1/4] [HLSL] Define the HLSLRootSignature Attr - Defines HLSLRootS

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-31 Thread Finn Plummer via llvm-branch-commits
@@ -10,13 +10,13 @@ Header: PartOffsets: [ 60 ] Parts: - Name:RTS0 -Size:8 +Size:4 inbelic wrote: Why should this change? https://github.com/llvm/llvm-project/pull/123147

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-31 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,74 @@ +//===- DXILRootSignature.h - DXIL Root Signature helper objects +//---===// +// +// 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-Identifie

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-31 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,157 @@ +//===- DXILRootSignature.cpp - DXIL Root Signature helper objects ===// +// +// 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: Apache-2

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-31 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,158 @@ +//===- DXILRootSignature.cpp - DXIL Root Signature helper objects ===// +// +// 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: Apache-2

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-31 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,157 @@ +//===- DXILRootSignature.cpp - DXIL Root Signature helper objects ===// +// +// 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: Apache-2

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-31 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: If you think it makes more sense to have the separate, then I think we should have at least 1 test-case that demonstrates multiple root-signatures https://github.com/llvm/llvm-project/pull/123147 ___ l

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-31 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: Are you able to merge all these testcases into one file? You should be able to define multiple root signatures on different entry functions right? https://github.com/llvm/llvm-project/pull/123147 ___ l

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-31 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: I guess we can't merge all these error tests because we error out on the first one? We should have at least one test that iterates on multiple root signatures though. https://github.com/llvm/llvm-project/pull/123147

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-31 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic deleted https://github.com/llvm/llvm-project/pull/123147 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-01-22 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/123985 >From 42932906dc811f2f6953d0902143419daa030be7 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 22 Jan 2025 17:53:59 + Subject: [PATCH 1/2] [HLSL] Define the HLSLRootSignature Attr - Defines HLSLRootS

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-01-22 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/123985 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-01-22 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/123985 - Defines HLSLRootSignature Attr in `Attr.td` - Define and implement handleHLSLRootSignature in `SemaHLSL` - Adds sample test case to show AST Node is generated in `RootSignatures-AST.hlsl` This commit will "ho

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-01-22 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/123985 >From 42932906dc811f2f6953d0902143419daa030be7 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 22 Jan 2025 17:53:59 + Subject: [PATCH 1/3] [HLSL] Define the HLSLRootSignature Attr - Defines HLSLRootS

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-22 Thread Finn Plummer via llvm-branch-commits
@@ -148,6 +148,333 @@ bool RootSignatureLexer::LexToken(RootSignatureToken &Result) { return false; } +// Parser Definitions + +RootSignatureParser::RootSignatureParser( +SmallVector &Elements, +const SmallVector &Tokens) +: Elements(Elements) { + CurTok = Toke

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-01-22 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic ready_for_review https://github.com/llvm/llvm-project/pull/123985 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-23 Thread Finn Plummer via llvm-branch-commits
@@ -148,6 +148,333 @@ bool RootSignatureLexer::LexToken(RootSignatureToken &Result) { return false; } +// Parser Definitions + +RootSignatureParser::RootSignatureParser( +SmallVector &Elements, +const SmallVector &Tokens) +: Elements(Elements) { + CurTok = Toke

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-23 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: Sounds good, and I appreciate the feedback. I will restructure the changes to be of smaller granularity, which will be better self-contained and directly include their diagnostics testing. https://github.com/llvm/llvm-project/pull/122982 _

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-23 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic converted_to_draft https://github.com/llvm/llvm-project/pull/122982 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-17 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/122982 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-17 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/122982 >From 58ef8ad2d3d9bfa008745b35f1514222c13b773a Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Tue, 14 Jan 2025 22:23:22 + Subject: [PATCH 1/3] [HLSL][RootSignature] Implement Parsing of Descriptor Tables

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-01-27 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/123985 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-01-27 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/123985 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-28 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/122982 >From 5ed5fcfebb395cdfe45dc41094e07716d2003d66 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Tue, 28 Jan 2025 17:49:21 + Subject: [PATCH 01/13] [HLSL][RootSignature] Handle an empty root signature - Def

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-28 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: Updated to include diagnostics output and the relevant testing. I have rebased to split the pr into smaller incremental changes, to help with review. And I have taken care to address all previous comments. Unfortunately the rebase causes these comments to get lost :/ I have imp

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-28 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic ready_for_review https://github.com/llvm/llvm-project/pull/122982 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-01-28 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/123985 >From 9efdfc1ca3d6c02e441715061ed04b52504bc179 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 22 Jan 2025 17:53:59 + Subject: [PATCH 1/3] [HLSL] Define the HLSLRootSignature Attr - Defines HLSLRootS

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-28 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/122982 >From 44d3086a5a8b53a734bbabe32d7c34195def2d65 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Fri, 24 Jan 2025 22:28:05 + Subject: [PATCH 01/17] [HLSL][RootSignature] Add lexing of integer literals - Int

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-28 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,140 @@ +//===- HLSLRootSignature.h - HLSL Root Signature helper objects ---===// +// +// 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

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-28 Thread Finn Plummer via llvm-branch-commits
@@ -148,6 +148,347 @@ bool RootSignatureLexer::LexToken(RootSignatureToken &Result) { return false; } +// Parser Definitions + +RootSignatureParser::RootSignatureParser( +SmallVector &Elements, +const SmallVector &Tokens) +: Elements(Elements) { + CurTok = Toke

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-28 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,140 @@ +//===- HLSLRootSignature.h - HLSL Root Signature helper objects ---===// +// +// 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

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-29 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/122982 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-02-14 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/122982 error: too big or took too long to generate ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-02-14 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/122982 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-02-14 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic deleted https://github.com/llvm/llvm-project/pull/122982 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-02-14 Thread Finn Plummer via llvm-branch-commits
@@ -306,4 +307,254 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexRegNumberTest) { ASSERT_FALSE(Consumer->IsSatisfied()); } +// Valid Parser Tests + +TEST_F(ParseHLSLRootSignatureTest, ValidParseEmptyTest) { + const llvm::StringLiteral Source = R"cc()cc"; + + TrivialModu

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-03-31 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/133800 - defines `ParamType` as a way to represent a reference to some parameter in a root signature - defines `ParseParam` and `ParseParams` as an infastructure to define how the parameters of a given struct should be

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-03-31 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/123985 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-16 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,18 @@ +; RUN: not opt -passes='print' %s -S -o - 2>&1 | FileCheck %s + +target triple = "dxil-unknown-shadermodel6.0-compute" + +; CHECK: error: Invalid value for Num32BitValues +; CHECK-NOT: Root Signature Definitions + +define void @main() #0 { +entry: + ret void +}

[llvm-branch-commits] [clang] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)

2025-04-22 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/136747 - It was determined to define the parsing methods much more inline with a recursive descent parser to follow the EBNF notation better - As part of this change, we decided to go with a calling convention to the

[llvm-branch-commits] [llvm] [DirectX] Adding support for Root Descriptor in Obj2yaml/Yaml2Obj (PR #136732)

2025-04-23 Thread Finn Plummer via llvm-branch-commits
@@ -594,6 +599,25 @@ struct RootConstants { sys::swapByteOrder(Num32BitValues); } }; +struct RootDescriptor_V1_0 { inbelic wrote: Having poked a bit more in `DXContainer.h`, maybe it would be best to follow how it is done for `RuntimeInfo`? Defining a n

[llvm-branch-commits] [llvm] [DirectX] Adding support for Root Descriptor in Obj2yaml/Yaml2Obj (PR #136732)

2025-04-23 Thread Finn Plummer via llvm-branch-commits
@@ -73,24 +75,50 @@ struct ShaderHash { std::vector Digest; }; -#define ROOT_ELEMENT_FLAG(Num, Val) bool Val = false; - struct RootConstantsYaml { uint32_t ShaderRegister; uint32_t RegisterSpace; uint32_t Num32BitValues; }; +#define ROOT_DESCRIPTOR_FLAG(Num, Val

[llvm-branch-commits] [llvm] [DirectX] Adding support for Root Descriptor in Obj2yaml/Yaml2Obj (PR #136732)

2025-04-23 Thread Finn Plummer via llvm-branch-commits
@@ -89,6 +111,15 @@ DXContainerYAML::RootSignatureYamlDesc::create( return RootSigDesc; } +uint32_t DXContainerYAML::RootDescriptorYaml::getEncodedFlags() const { + uint64_t Flag = 0; +#define ROOT_DESCRIPTOR_FLAG(Num, Val) \ + if (

[llvm-branch-commits] [llvm] [DirectX] Adding support for Root Descriptor in Obj2yaml/Yaml2Obj (PR #136732)

2025-04-23 Thread Finn Plummer via llvm-branch-commits
@@ -594,6 +599,25 @@ struct RootConstants { sys::swapByteOrder(Num32BitValues); } }; +struct RootDescriptor_V1_0 { inbelic wrote: IIUC, this is how the structs were defined and planned to be extended in DXC. And I believe it was also documented there th

[llvm-branch-commits] [llvm] [DirectX] Adding support for Root Descriptor in Obj2yaml/Yaml2Obj (PR #136732)

2025-04-23 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/136732 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add mandatory parameters for RootConstants (PR #138002)

2025-04-30 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/138002 - defines the `parseRootConstantParams` function and adds handling for the mandatory arguments of `num32BitConstants` and `bReg` - adds corresponding unit tests Part two of implementing #126576 >From 15857bf

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add mandatory parameters for RootConstants (PR #138002)

2025-04-30 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/138002 >From 15857bf8e1303e2325b48e417e7abd26aa77910e Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 30 Apr 2025 17:53:11 + Subject: [PATCH] [HLSL][RootSignature] Add mandatory parameters for RootConstants

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add optional parameter for RootConstants (PR #138007)

2025-04-30 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/138007 - extends `parseRootConstantParams` and the struct to include the optional parameters of a RootConstant - adds corresponding unit tests Part three of and resolves https://github.com/llvm/llvm-project/issues/12

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add optional parameters for RootConstants (PR #138007)

2025-04-30 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/138007 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add mandatory parameters for RootConstants (PR #138002)

2025-04-30 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/138002 >From 15857bf8e1303e2325b48e417e7abd26aa77910e Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 30 Apr 2025 17:53:11 + Subject: [PATCH 1/2] [HLSL][RootSignature] Add mandatory parameters for RootConst

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-14 Thread Finn Plummer via llvm-branch-commits
@@ -94,10 +144,56 @@ static bool parse(LLVMContext *Ctx, mcdxbc::RootSignatureDesc &RSD, static bool verifyRootFlag(uint32_t Flags) { return (Flags & ~0xfff) == 0; } +static bool verifyShaderVisibility(dxbc::ShaderVisibility Flags) { + switch (Flags) { + + case dxbc::Shade

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-14 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: I think we should change the name of the file to be more descriptive https://github.com/llvm/llvm-project/pull/135085 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://list

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-14 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: The test name implies that we are only testing root constants. Can we either change the name or remove root flags https://github.com/llvm/llvm-project/pull/135085 ___ llvm-branch-commits mailing list l

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-14 Thread Finn Plummer via llvm-branch-commits
@@ -52,6 +59,45 @@ static bool parseRootFlags(LLVMContext *Ctx, mcdxbc::RootSignatureDesc &RSD, return false; } +static bool extractMdValue(uint32_t &Value, MDNode *Node, unsigned int OpId) { inbelic wrote: We could use this for `parseRootFlags` as well to

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-14 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,34 @@ +; RUN: opt %s -dxil-embed -dxil-globals -S -o - | FileCheck %s +; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC + +target triple = "dxil-unknown-shadermodel6.0-compute" + +; CHECK: @dx.rts0 = private constant [48 x i8] c"{{.*}}", s

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-14 Thread Finn Plummer via llvm-branch-commits
@@ -94,10 +144,56 @@ static bool parse(LLVMContext *Ctx, mcdxbc::RootSignatureDesc &RSD, static bool verifyRootFlag(uint32_t Flags) { return (Flags & ~0xfff) == 0; } +static bool verifyShaderVisibility(dxbc::ShaderVisibility Flags) { + switch (Flags) { + + case dxbc::Shade

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-14 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: I think you meant this to be a new test file and not to edit the root flags validation. Can we also remove the "RootFlags" member to reduce noise. https://github.com/llvm/llvm-project/pull/135085 ___

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-14 Thread Finn Plummer via llvm-branch-commits
@@ -52,6 +59,45 @@ static bool parseRootFlags(LLVMContext *Ctx, mcdxbc::RootSignatureDesc &RSD, return false; } +static bool extractMdValue(uint32_t &Value, MDNode *Node, unsigned int OpId) { inbelic wrote: Maybe we could rename this to `extractMdIntValue`

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-16 Thread Finn Plummer via llvm-branch-commits
@@ -94,10 +144,56 @@ static bool parse(LLVMContext *Ctx, mcdxbc::RootSignatureDesc &RSD, static bool verifyRootFlag(uint32_t Flags) { return (Flags & ~0xfff) == 0; } +static bool verifyShaderVisibility(dxbc::ShaderVisibility Flags) { + switch (Flags) { + + case dxbc::Shade

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add parsing for RootFlags (PR #138055)

2025-04-30 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/138055 - defines the `RootFlags` in-memory enum - defines `parseRootFlags` to parse the various flag enums into a single `uint32_t` - adds corresponding unit tests - improves the diagnostic message for when we provide

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

2025-05-02 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/137690 >From 0ccff5b9be4f876969e4db439e67edbc7af6cb29 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Mon, 28 Apr 2025 18:42:10 + Subject: [PATCH 01/13] [HLSL][RootSignature] Define and integrate rootsig clang a

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

2025-05-02 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/137690 >From 0ccff5b9be4f876969e4db439e67edbc7af6cb29 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Mon, 28 Apr 2025 18:42:10 + Subject: [PATCH 01/14] [HLSL][RootSignature] Define and integrate rootsig clang a

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

2025-05-02 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: This is rebased onto: https://github.com/llvm/llvm-project/pull/138326 which defines a serialization of the in-memory structures. As such, the test-case in RootSignatures-AST.hlsl is updated to show that the values are correctly stored in the decl node. https://github.com/llvm/

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

2025-05-02 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/137690 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Adding support for Root Descriptor in Obj2yaml/Yaml2Obj (PR #136732)

2025-04-23 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: Maybe this was covered in the first pr. But are there tests that cover both big and little endian? https://github.com/llvm/llvm-project/pull/136732 ___ llvm-branch-commits mailing list llvm-branch-comm

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add parsing of remaining Descriptor Table params (PR #137038)

2025-04-23 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/137038 - defines the special values for `DESCRIPTOR_RANGE_OFFSET_APPEND` and `unbounded` for the `offset` and `numDescriptors` parameters respectively - adds these parmaters to the `DescriptorClause` struct and the par

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add parsing of remaining Descriptor Table params (PR #137038)

2025-04-23 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/137038 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [NFC][HLSL][RootSignature] Move `HLSLRootSignatureParser` into clangSema (PR #137381)

2025-04-25 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/137381 Noting: - Currently, `HLSLRootSignatureParser` is defined in `clangParse`, as it would naturally seem an appropriate place to place. - Surprisingly, `clangParse` has a dependency on `clangSema`. So we can't in

[llvm-branch-commits] [clang] [NFC][HLSL][RootSignature] Move `HLSLRootSignatureParser` into `clangSema` (PR #137381)

2025-04-25 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/137381 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [NFC][HLSL][RootSignature] Move `HLSLRootSignatureParser` into `clangSema` (PR #137381)

2025-04-25 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/137381 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-15 Thread Finn Plummer via llvm-branch-commits
@@ -24,7 +24,11 @@ namespace llvm { namespace dxil { -enum class RootSignatureElementKind { Error = 0, RootFlags = 1 }; +enum class RootSignatureElementKind { inbelic wrote: What is the reason to define this instead of just using `dxbc::RootParameterType`. T

[llvm-branch-commits] [llvm] [HLSL] Adding support for Root Constants in LLVM Metadata (PR #135085)

2025-04-15 Thread Finn Plummer via llvm-branch-commits
@@ -52,6 +59,45 @@ static bool parseRootFlags(LLVMContext *Ctx, mcdxbc::RootSignatureDesc &RSD, return false; } +static bool extractMdValue(uint32_t &Value, MDNode *Node, unsigned int OpId) { + + auto *CI = mdconst::extract(Node->getOperand(OpId)); + if (CI == nullptr) +

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add optional parameters for RootConstants (PR #138007)

2025-05-01 Thread Finn Plummer via llvm-branch-commits
@@ -255,7 +255,9 @@ TEST_F(ParseHLSLRootSignatureTest, ValidSamplerFlagsTest) { TEST_F(ParseHLSLRootSignatureTest, ValidParseRootConsantsTest) { inbelic wrote: Sure, I can add more. Just wasn't sure what the right balance is, as many of the error reports are al

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add optional parameters for RootConstants (PR #138007)

2025-05-01 Thread Finn Plummer via llvm-branch-commits
@@ -82,6 +82,8 @@ class RootSignatureParser { struct ParsedConstantParams { std::optional Reg; std::optional Num32BitConstants; +std::optional Space; inbelic wrote: I think having it separate maps closer and clearer to the metadata and parameter

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add Metadata generation of Root Signatures for Attr (PR #125131)

2025-03-07 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -emit-llvm -o - %s | FileCheck %s + +// CHECK: !dx.rootsignatures = !{![[#FIRST_ENTRY:]], ![[#SECOND_ENTRY:]]} + +// CHECK: ![[#FIRST_ENTRY]] = !{ptr @FirstEntry, ![[#EMPTY:]]} +// CHECK: ![[#EMPTY]] = !{

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add Metadata generation of Root Signatures for Attr (PR #125131)

2025-03-07 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,108 @@ +//===- HLSLRootSignature.cpp - HLSL Root Signature helper objects +//--===// +// +// 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:

[llvm-branch-commits] [llvm] [DirectX] Updating DXContainer documentation to add Root Descriptors (PR #129759)

2025-03-10 Thread Finn Plummer via llvm-branch-commits
@@ -497,3 +497,49 @@ signature and passed to the shader without requiring a constant buffer resource: #. **Num32BitValues**: The number of 32-bit values included in this constant buffer. Root constants provide a fast way to pass small amounts of data directly to the shader

[llvm-branch-commits] [llvm] [DirectX] Updating DXContainer documentation to add Root Descriptors (PR #129759)

2025-03-10 Thread Finn Plummer via llvm-branch-commits
@@ -497,3 +497,49 @@ signature and passed to the shader without requiring a constant buffer resource: #. **Num32BitValues**: The number of 32-bit values included in this constant buffer. Root constants provide a fast way to pass small amounts of data directly to the shader

[llvm-branch-commits] [llvm] [DirectX] Updating Root Signature documentation with Descriptor table description (PR #129797)

2025-03-11 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/129797 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Updating Root Signature documentation with Descriptor table description (PR #129797)

2025-03-11 Thread Finn Plummer via llvm-branch-commits
@@ -544,3 +544,73 @@ Version 1.1 Root Descriptor The Version 1.1 RootDescriptor_V1_1 extends the base structure with the following additional fields: #. **Flags**: Provides additional metadata about the descriptor's usage pattern. + +Root Descriptor Table +~~

[llvm-branch-commits] [llvm] [DirectX] Updating Root Signature documentation with Descriptor table description (PR #129797)

2025-03-11 Thread Finn Plummer via llvm-branch-commits
@@ -544,3 +544,73 @@ Version 1.1 Root Descriptor The Version 1.1 RootDescriptor_V1_1 extends the base structure with the following additional fields: #. **Flags**: Provides additional metadata about the descriptor's usage pattern. + +Root Descriptor Table +~~

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add Metadata generation of Root Signatures for Attr (PR #125131)

2025-03-05 Thread Finn Plummer via llvm-branch-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -emit-llvm -o - %s | FileCheck %s + +// CHECK-DAG: ![[#EMPTY:]] = !{} +[shader("compute"), RootSignature("")] +[numthreads(1,1,1)] +void FirstEntry() {} + +// CHECK-DAG: ![[#CBV:]] = !{!"CBV", i32 1, i32

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add Metadata generation of Root Signatures for Attr (PR #125131)

2025-03-05 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/125131 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add Metadata generation of Root Signatures for Attr (PR #125131)

2025-03-05 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/125131 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add Metadata generation of Root Signatures for Attr (PR #125131)

2025-03-05 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/125131 >From abe7e6703a008608e19ce3f9bdcbd1b613fab60d Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 29 Jan 2025 19:40:08 + Subject: [PATCH 1/7] add basic empty root signature --- clang/lib/CodeGen/CGHLSL

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add Metadata generation of Root Signatures for Attr (PR #125131)

2025-02-12 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/125131 >From abe7e6703a008608e19ce3f9bdcbd1b613fab60d Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 29 Jan 2025 19:40:08 + Subject: [PATCH 1/6] add basic empty root signature --- clang/lib/CodeGen/CGHLSL

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Add Metadata generation of Root Signatures for Attr (PR #125131)

2025-02-12 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic ready_for_review https://github.com/llvm/llvm-project/pull/125131 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-02-12 Thread Finn Plummer via llvm-branch-commits
@@ -647,6 +648,40 @@ void SemaHLSL::emitLogicalOperatorFixIt(Expr *LHS, Expr *RHS, << NewFnName << FixItHint::CreateReplacement(FullRange, OS.str()); } +void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) { + if (AL.getNumArgs() != 1) +return; + +

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-02-12 Thread Finn Plummer via llvm-branch-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/123985 >From d9b0d8ee0f8420c56a6c2c5e0c2234fbc2a22d7e Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 22 Jan 2025 17:53:59 + Subject: [PATCH 1/9] [HLSL] Define the HLSLRootSignature Attr - Defines HLSLRootS

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-02-12 Thread Finn Plummer via llvm-branch-commits
inbelic wrote: > I was expectng a change in `CGHLSLRuntime.cpp` that did something with the > root signature attribute. Is there a reason why we aren't? That seems to be > the pattern for other prs like this for `WaveSizeAttr` and > `HLSLNumThreadsAttr`. Yep, we will be using that to emit the

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-02-12 Thread Finn Plummer via llvm-branch-commits
@@ -647,6 +648,40 @@ void SemaHLSL::emitLogicalOperatorFixIt(Expr *LHS, Expr *RHS, << NewFnName << FixItHint::CreateReplacement(FullRange, OS.str()); } +void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) { + if (AL.getNumArgs() != 1) +return; + +

  1   2   3   >