-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[DirectX] use DXILMetadataAnalysis to build PSVRuntimeInfo #107101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
48cd044
a93e54e
aa93446
816ceb4
17d08e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
#include "DXILShaderFlags.h" | ||
#include "DirectX.h" | ||
#include "llvm/ADT/StringSet.h" | ||
#include "llvm/Analysis/DXILMetadataAnalysis.h" | ||
#include "llvm/Analysis/DXILResource.h" | ||
#include "llvm/IR/Constants.h" | ||
#include "llvm/IR/Metadata.h" | ||
|
@@ -103,6 +104,7 @@ class DXILTranslateMetadataLegacy : public ModulePass { | |
AU.addRequired<DXILResourceWrapperPass>(); | ||
AU.addRequired<DXILResourceMDWrapper>(); | ||
AU.addRequired<ShaderFlagsAnalysisWrapper>(); | ||
AU.addRequired<DXILMetadataAnalysisWrapperPass>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The analysis needs to be run before preparePass which removes the attributes. |
||
} | ||
|
||
bool runOnModule(Module &M) override { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
; 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.psv0 = private constant [80 x i8] c"{{.*}}", section "PSV0", align 4 | ||
|
||
define void @cs_main() #0 { | ||
entry: | ||
ret void | ||
} | ||
|
||
attributes #0 = { "hlsl.numthreads"="8,8,1" "hlsl.shader"="compute" } | ||
|
||
!dx.valver = !{!0} | ||
|
||
!0 = !{i32 1, i32 7} | ||
|
||
; DXC: - Name: PSV0 | ||
; DXC-NEXT: Size: 80 | ||
; DXC-NEXT: PSVInfo: | ||
; DXC-NEXT: Version: 3 | ||
; DXC-NEXT: ShaderStage: 5 | ||
; DXC-NEXT: MinimumWaveLaneCount: 0 | ||
; DXC-NEXT: MaximumWaveLaneCount: 4294967295 | ||
; DXC-NEXT: UsesViewID: 0 | ||
; DXC-NEXT: SigInputVectors: 0 | ||
; DXC-NEXT: SigOutputVectors: [ 0, 0, 0, 0 ] | ||
; DXC-NEXT: NumThreadsX: 8 | ||
; DXC-NEXT: NumThreadsY: 8 | ||
; DXC-NEXT: NumThreadsZ: 1 | ||
; DXC-NEXT: EntryName: cs_main | ||
; DXC-NEXT: ResourceStride: 24 | ||
; DXC-NEXT: Resources: [] | ||
; DXC-NEXT: SigInputElements: [] | ||
; DXC-NEXT: SigOutputElements: [] | ||
; DXC-NEXT: SigPatchOrPrimElements: [] | ||
; DXC-NEXT: InputOutputMap: | ||
; DXC-NEXT: - [ ] | ||
; DXC-NEXT: - [ ] | ||
; DXC-NEXT: - [ ] | ||
; DXC-NEXT: - [ ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems pretty unfortunate that we need to know which fields are valid in the analysis result based on what stage it is - I see you made a similar comment on the metadata analysis PR, but I didn't notice it at the time. We should probably have a discussion on what the API of the metadata analysis should look like (cc @bharadwajy).