S. Bharadwaj Yadavalli 3734fa8c72
[DXIL] Consume Metadata Analysis information in passes (#108034)
- Changed `DXILTranslateMetadata::translateMetadata()` to consume DXIL
Metadata Analysis information. Subsumed into `DXILTranslateMetedata.cpp`
the functionality in `DXILMetadata.*` files - that are hence deleted.
- Changed `DXILPrepare` pass to consume DXIL Metadata Analysis
information.
- Renamed `ModuleMetadataInfo::ShaderStage` to
`ModuleMetadataInfo::ShaderProfile` to better convey what it represents.
- Updated `unknown` target shader stage specification in triples of a
couple of tests.
- Added new tests for additional verification of `DXILTranslateMetadata`
pass functionality.
2024-09-23 19:00:20 -04:00

38 lines
1.2 KiB
LLVM

; RUN: opt -S -S -dxil-translate-metadata %s 2>&1 | FileCheck %s
target triple = "dxil-pc-shadermodel6.8-library"
; CHECK: !dx.shaderModel = !{![[SM:[0-9]+]]}
; CHECK: !dx.version = !{![[DXVER:[0-9]+]]}
; CHECK: !dx.entryPoints = !{![[LIB:[0-9]+]], ![[AS:[0-9]+]], ![[MS:[0-9]+]], ![[CS:[0-9]+]]}
; CHECK: ![[SM]] = !{!"lib", i32 6, i32 8}
; CHECK: ![[DXVER]] = !{i32 1, i32 8}
; CHECK: ![[LIB]] = !{null, !"", null, null, null}
; CHECK: ![[AS]] = !{ptr @entry_as, !"entry_as", null, null, ![[AS_SF:[0-9]*]]}
; CHECK: ![[AS_SF]] = !{i32 8, i32 14}
; CHECK: ![[MS]] = !{ptr @entry_ms, !"entry_ms", null, null, ![[MS_SF:[0-9]*]]}
; CHECK: ![[MS_SF]] = !{i32 8, i32 13}
; CHECK: ![[CS]] = !{ptr @entry_cs, !"entry_cs", null, null, ![[CS_SF:[0-9]*]]}
; CHECK: ![[CS_SF]] = !{i32 8, i32 5, i32 4, ![[CS_NT:[0-9]*]]}
; CHECK: !{i32 1, i32 2, i32 1}
define void @entry_as() #0 {
entry:
ret void
}
define i32 @entry_ms(i32 %a) #1 {
entry:
ret i32 %a
}
define float @entry_cs(float %f) #3 {
entry:
ret float %f
}
attributes #0 = { noinline nounwind "hlsl.shader"="amplification" }
attributes #1 = { noinline nounwind "hlsl.shader"="mesh" }
attributes #3 = { noinline nounwind "hlsl.numthreads"="1,2,1" "hlsl.shader"="compute" }