-
Notifications
You must be signed in to change notification settings - Fork 851
[SER] MaybeReorderThread DXIL opcode and validation #7256
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6237780
[SER] MaybeReorderThread DXIL opcode and validation
simoll 6d96524
Merge remote-tracking branch 'msft/main' into ser_dxilreorder_patch
simoll 0f4ef28
Validate HitObject/NumCoherenceBits is not undef / Validate
simoll 2d18a63
Merge remote-tracking branch 'msft/main' into ser_dxilreorder_patch
simoll abd03a8
[nfc] Update MaybeReorderThread description (must not be 'undef' as s…
simoll 9328d0c
nfc: autformat hctdb.py
simoll 16bf5b6
Merge remote-tracking branch 'ms/main' into ser_dxilreorder_patch
tex3d 6fa67b4
Add category and shader model to MaybeReorderThread
tex3d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
tools/clang/test/LitDXILValidation/ser_maybereorder_failing.ll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| ; REQUIRES: dxil-1-9 | ||
| ; RUN: not %dxv %s 2>&1 | FileCheck %s | ||
|
|
||
| target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" | ||
| target triple = "dxil-ms-dx" | ||
|
|
||
| %dx.types.HitObject = type { i8* } | ||
|
|
||
| ; CHECK: Function: ?main@@YAXXZ: error: Use of undef coherence hint or num coherence hint bits in MaybeReorderThread. | ||
| ; CHECK-NEXT: note: at 'call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject %nop, i32 1, i32 undef)' | ||
|
|
||
| ; CHECK: Function: ?main@@YAXXZ: error: Use of undef coherence hint or num coherence hint bits in MaybeReorderThread. | ||
| ; CHECK-NEXT: note: at 'call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject %nop, i32 undef, i32 1)' | ||
|
|
||
| ; CHECK: Function: ?main@@YAXXZ: error: HitObject is undef. | ||
| ; CHECK-NEXT: note: at 'call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject undef, i32 11, i32 0)' | ||
|
|
||
| ; CHECK: Validation failed. | ||
|
|
||
| ; Function Attrs: nounwind | ||
| define void @"\01?main@@YAXXZ"() #0 { | ||
| %nop = call %dx.types.HitObject @dx.op.hitObject_MakeNop(i32 266) ; HitObject_MakeNop() | ||
|
|
||
| ; Validate that hit object is not undef. | ||
| call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject undef, i32 11, i32 0) ; MaybeReorderThread(hitObject,coherenceHint,numCoherenceHintBitsFromLSB) | ||
|
|
||
| ; Validate that coherence hint is not undef while numCoherenceHintBitsFromLSB is not 0. | ||
| call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject %nop, i32 undef, i32 1) ; MaybeReorderThread(hitObject,coherenceHint,numCoherenceHintBitsFromLSB) | ||
|
|
||
| ; Validate that num coherence hint bits from LSB is not undef. | ||
| call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject %nop, i32 1, i32 undef) ; MaybeReorderThread(hitObject,coherenceHint,numCoherenceHintBitsFromLSB) | ||
| ret void | ||
| } | ||
|
|
||
| ; Function Attrs: nounwind readnone | ||
| declare %dx.types.HitObject @dx.op.hitObject_MakeNop(i32) #1 | ||
|
|
||
| ; Function Attrs: nounwind | ||
| declare void @dx.op.maybeReorderThread(i32, %dx.types.HitObject, i32, i32) #0 | ||
|
|
||
| attributes #0 = { nounwind } | ||
| attributes #1 = { nounwind readnone } | ||
|
|
||
| !dx.version = !{!0} | ||
| !dx.valver = !{!0} | ||
| !dx.shaderModel = !{!1} | ||
| !dx.typeAnnotations = !{!2} | ||
| !dx.entryPoints = !{!6, !8} | ||
|
|
||
| !0 = !{i32 1, i32 9} | ||
| !1 = !{!"lib", i32 6, i32 9} | ||
| !2 = !{i32 1, void ()* @"\01?main@@YAXXZ", !3} | ||
| !3 = !{!4} | ||
| !4 = !{i32 1, !5, !5} | ||
| !5 = !{} | ||
| !6 = !{null, !"", null, null, !7} | ||
| !7 = !{i32 0, i64 0} | ||
| !8 = !{void ()* @"\01?main@@YAXXZ", !"\01?main@@YAXXZ", null, null, !9} | ||
| !9 = !{i32 8, i32 7, i32 5, !10} | ||
| !10 = !{i32 0} |
46 changes: 46 additions & 0 deletions
46
tools/clang/test/LitDXILValidation/ser_maybereorder_passing.ll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| ; REQUIRES: dxil-1-9 | ||
| ; RUN: %dxv %s | FileCheck %s | ||
|
|
||
| ; CHECK: Validation succeeded. | ||
|
|
||
| target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" | ||
| target triple = "dxil-ms-dx" | ||
|
|
||
| %dx.types.HitObject = type { i8* } | ||
|
|
||
| ; Function Attrs: nounwind | ||
| define void @"\01?main@@YAXXZ"() #0 { | ||
| %nop = call %dx.types.HitObject @dx.op.hitObject_MakeNop(i32 266) ; HitObject_MakeNop() | ||
| call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject %nop, i32 241, i32 3) ; MaybeReorderThread(hitObject,coherenceHint,numCoherenceHintBitsFromLSB) | ||
|
|
||
| ; Coherence hint disabled, accept 'undef' coherence hint bits. | ||
| call void @dx.op.maybeReorderThread(i32 268, %dx.types.HitObject %nop, i32 undef, i32 0) ; MaybeReorderThread(hitObject,coherenceHint,numCoherenceHintBitsFromLSB) | ||
| ret void | ||
| } | ||
|
|
||
| ; Function Attrs: nounwind readnone | ||
| declare %dx.types.HitObject @dx.op.hitObject_MakeNop(i32) #1 | ||
|
|
||
| ; Function Attrs: nounwind | ||
| declare void @dx.op.maybeReorderThread(i32, %dx.types.HitObject, i32, i32) #0 | ||
|
|
||
| attributes #0 = { nounwind } | ||
| attributes #1 = { nounwind readnone } | ||
|
|
||
| !dx.version = !{!0} | ||
| !dx.valver = !{!0} | ||
| !dx.shaderModel = !{!1} | ||
| !dx.typeAnnotations = !{!2} | ||
| !dx.entryPoints = !{!6, !8} | ||
|
|
||
| !0 = !{i32 1, i32 9} | ||
| !1 = !{!"lib", i32 6, i32 9} | ||
| !2 = !{i32 1, void ()* @"\01?main@@YAXXZ", !3} | ||
| !3 = !{!4} | ||
| !4 = !{i32 1, !5, !5} | ||
| !5 = !{} | ||
| !6 = !{null, !"", null, null, !7} | ||
| !7 = !{i32 0, i64 0} | ||
| !8 = !{void ()* @"\01?main@@YAXXZ", !"\01?main@@YAXXZ", null, null, !9} | ||
| !9 = !{i32 8, i32 7, i32 5, !10} | ||
| !10 = !{i32 0} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.