Skip to content

Commit 77ddffc

Browse files
joaosaffranjoaosaffran
andauthored
[HLSL] Fix Root signature test error (#127261)
Fixing error detected in build bot in file `RootSignature-MultipleEntryFunctions.ll` closes: [127260](#127260) --------- Co-authored-by: joaosaffran <[email protected]>
1 parent 9f6e72b commit 77ddffc

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

llvm/lib/Target/DirectX/DXILRootSignature.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,20 +186,23 @@ PreservedAnalyses RootSignatureAnalysisPrinter::run(Module &M,
186186
OS << "Root Signature Definitions"
187187
<< "\n";
188188
uint8_t Space = 0;
189-
for (const auto &P : RSDMap) {
190-
const auto &[Function, RSD] = P;
191-
OS << "Definition for '" << Function->getName() << "':\n";
189+
for (const Function &F : M) {
190+
auto It = RSDMap.find(&F);
191+
if (It == RSDMap.end())
192+
continue;
193+
const auto &RS = It->second;
194+
OS << "Definition for '" << F.getName() << "':\n";
192195

193196
// start root signature header
194197
Space++;
195-
OS << indent(Space) << "Flags: " << format_hex(RSD.Flags, 8) << ":\n";
196-
OS << indent(Space) << "Version: " << RSD.Version << ":\n";
197-
OS << indent(Space) << "NumParameters: " << RSD.NumParameters << ":\n";
198-
OS << indent(Space) << "RootParametersOffset: " << RSD.RootParametersOffset
198+
OS << indent(Space) << "Flags: " << format_hex(RS.Flags, 8) << ":\n";
199+
OS << indent(Space) << "Version: " << RS.Version << ":\n";
200+
OS << indent(Space) << "NumParameters: " << RS.NumParameters << ":\n";
201+
OS << indent(Space) << "RootParametersOffset: " << RS.RootParametersOffset
199202
<< ":\n";
200-
OS << indent(Space) << "NumStaticSamplers: " << RSD.NumStaticSamplers
203+
OS << indent(Space) << "NumStaticSamplers: " << RS.NumStaticSamplers
201204
<< ":\n";
202-
OS << indent(Space) << "StaticSamplersOffset: " << RSD.StaticSamplersOffset
205+
OS << indent(Space) << "StaticSamplersOffset: " << RS.StaticSamplersOffset
203206
<< ":\n";
204207
Space--;
205208
// end root signature header

llvm/test/CodeGen/DirectX/ContainerData/RootSignature-MultipleEntryFunctions.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ attributes #0 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" }
2323
!6 = !{ !7 } ; list of root signature elements
2424
!7 = !{ !"RootFlags", i32 2 } ; 1 = allow_input_assembler_input_layout
2525

26-
2726
; CHECK-LABEL: Definition for 'main':
2827
; CHECK-NEXT: Flags: 0x000001
2928
; CHECK-NEXT: Version: 2

0 commit comments

Comments
 (0)