diff --git a/llvm/lib/Target/DirectX/DXILRootSignature.cpp b/llvm/lib/Target/DirectX/DXILRootSignature.cpp index 49fc892eade5d..0fecbd698bc5f 100644 --- a/llvm/lib/Target/DirectX/DXILRootSignature.cpp +++ b/llvm/lib/Target/DirectX/DXILRootSignature.cpp @@ -186,20 +186,23 @@ PreservedAnalyses RootSignatureAnalysisPrinter::run(Module &M, OS << "Root Signature Definitions" << "\n"; uint8_t Space = 0; - for (const auto &P : RSDMap) { - const auto &[Function, RSD] = P; - OS << "Definition for '" << Function->getName() << "':\n"; + for (const Function &F : M) { + auto It = RSDMap.find(&F); + if (It == RSDMap.end()) + continue; + const auto &RS = It->second; + OS << "Definition for '" << F.getName() << "':\n"; // start root signature header Space++; - OS << indent(Space) << "Flags: " << format_hex(RSD.Flags, 8) << ":\n"; - OS << indent(Space) << "Version: " << RSD.Version << ":\n"; - OS << indent(Space) << "NumParameters: " << RSD.NumParameters << ":\n"; - OS << indent(Space) << "RootParametersOffset: " << RSD.RootParametersOffset + OS << indent(Space) << "Flags: " << format_hex(RS.Flags, 8) << ":\n"; + OS << indent(Space) << "Version: " << RS.Version << ":\n"; + OS << indent(Space) << "NumParameters: " << RS.NumParameters << ":\n"; + OS << indent(Space) << "RootParametersOffset: " << RS.RootParametersOffset << ":\n"; - OS << indent(Space) << "NumStaticSamplers: " << RSD.NumStaticSamplers + OS << indent(Space) << "NumStaticSamplers: " << RS.NumStaticSamplers << ":\n"; - OS << indent(Space) << "StaticSamplersOffset: " << RSD.StaticSamplersOffset + OS << indent(Space) << "StaticSamplersOffset: " << RS.StaticSamplersOffset << ":\n"; Space--; // end root signature header diff --git a/llvm/test/CodeGen/DirectX/ContainerData/RootSignature-MultipleEntryFunctions.ll b/llvm/test/CodeGen/DirectX/ContainerData/RootSignature-MultipleEntryFunctions.ll index 652f8092b7a69..7adb17d0b022f 100644 --- a/llvm/test/CodeGen/DirectX/ContainerData/RootSignature-MultipleEntryFunctions.ll +++ b/llvm/test/CodeGen/DirectX/ContainerData/RootSignature-MultipleEntryFunctions.ll @@ -23,7 +23,6 @@ attributes #0 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" } !6 = !{ !7 } ; list of root signature elements !7 = !{ !"RootFlags", i32 2 } ; 1 = allow_input_assembler_input_layout - ; CHECK-LABEL: Definition for 'main': ; CHECK-NEXT: Flags: 0x000001 ; CHECK-NEXT: Version: 2