-
Notifications
You must be signed in to change notification settings - Fork 827
Implement DebugBreak and IsDebuggerPresent #8106
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
+385
−8
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8717ac5
Implement DebugBreak and IsDebuggerPresent
JoeCitizen 25b9797
formatting
JoeCitizen c891293
remove whitespace
JoeCitizen a749246
Merge branch 'microsoft:main' into Debug-Break
JoeCitizen a7ba920
Missed generated file
JoeCitizen a5afec5
Move release notes section
JoeCitizen 1521197
merge
JoeCitizen d38a576
fix build after merge
JoeCitizen bebc171
Fix bad grammar
JoeCitizen 0d6b958
Add the opcode to the file check
JoeCitizen 173024c
Add AST and FCGL checks
JoeCitizen bf2a1f6
Add DxilGen tests
JoeCitizen 1652202
Verify source location for SPIR-V lowering
JoeCitizen 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
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
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
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,12 @@ | ||
| // RUN: %dxc -T cs_6_10 -spirv %s | FileCheck %s | ||
|
|
||
| // CHECK: OpExtension "SPV_KHR_non_semantic_info" | ||
| // CHECK: OpExtInstImport "NonSemantic.DebugBreak" | ||
| // CHECK: OpExtInst %void {{%[0-9]+}} 1 | ||
|
|
||
| [numthreads(8, 8, 1)] | ||
| void main(uint3 threadId : SV_DispatchThreadID) { | ||
| if (threadId.x == 0) { | ||
| DebugBreak(); | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
tools/clang/test/CodeGenSPIRV/intrinsics.isdebugerpresent.error.hlsl
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,12 @@ | ||
| // RUN: not %dxc -T cs_6_10 -spirv %s 2>&1 | FileCheck %s | ||
|
|
||
| // CHECK: :9:9: error: no equivalent for IsDebuggerPresent intrinsic function in Vulkan | ||
|
|
||
| RWStructuredBuffer<uint> Output : register(u0); | ||
|
|
||
| [numthreads(8, 8, 1)] | ||
| void main(uint3 threadId : SV_DispatchThreadID) { | ||
| if (dx::IsDebuggerPresent()) { | ||
| Output[threadId.x] = 1; | ||
| } | ||
| } |
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,59 @@ | ||
| ; REQUIRES: dxil-1-10 | ||
| ; RUN: %dxopt %s -hlsl-passes-resume -dxilgen -S | FileCheck %s | ||
|
|
||
| ; CHECK: call void @dx.op.debugBreak(i32 -2147483615) | ||
|
|
||
| ; Generated from: | ||
| ; dxc -T cs_6_10 -fcgl tools/clang/test/HLSLFileCheckLit/hlsl/intrinsics/basic/debugbreak.hlsl | ||
| ; Debug info manually stripped. | ||
|
|
||
| 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" | ||
|
|
||
| ; Function Attrs: nounwind | ||
| define void @main(<3 x i32> %threadId) #0 { | ||
| entry: | ||
| %0 = extractelement <3 x i32> %threadId, i32 0 | ||
| %cmp = icmp eq i32 %0, 0 | ||
| br i1 %cmp, label %if.then, label %if.end | ||
|
|
||
| if.then: | ||
| call void @"dx.hl.op..void (i32)"(i32 425) | ||
| br label %if.end | ||
|
|
||
| if.end: | ||
| ret void | ||
| } | ||
|
|
||
| ; Function Attrs: nounwind | ||
| declare void @"dx.hl.op..void (i32)"(i32) #0 | ||
|
|
||
| attributes #0 = { nounwind } | ||
|
|
||
| !pauseresume = !{!0} | ||
| !llvm.ident = !{!1} | ||
| !dx.version = !{!2} | ||
| !dx.valver = !{!2} | ||
| !dx.shaderModel = !{!3} | ||
| !dx.typeAnnotations = !{!4} | ||
| !dx.entryPoints = !{!10} | ||
| !dx.fnprops = !{!14} | ||
| !dx.options = !{!15, !16} | ||
|
|
||
| !0 = !{!"hlsl-hlemit", !"hlsl-hlensure"} | ||
| !1 = !{!"dxc(private) 1.9.0.5167 (Debug-Break, c89129305)"} | ||
| !2 = !{i32 1, i32 10} | ||
| !3 = !{!"cs", i32 6, i32 10} | ||
| !4 = !{i32 1, void (<3 x i32>)* @main, !5} | ||
| !5 = !{!6, !8} | ||
| !6 = !{i32 1, !7, !7} | ||
| !7 = !{} | ||
| !8 = !{i32 0, !9, !7} | ||
| !9 = !{i32 4, !"SV_DispatchThreadID", i32 7, i32 5, i32 13, i32 3} | ||
| !10 = !{void (<3 x i32>)* @main, !"main", null, !11, null} | ||
| !11 = !{null, null, null, null} | ||
| !12 = !{} | ||
| !13 = !{i32 0} | ||
| !14 = !{void (<3 x i32>)* @main, i32 5, i32 8, i32 8, i32 1} | ||
| !15 = !{i32 -2147483584} | ||
| !16 = !{i32 -1} |
Oops, something went wrong.
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.
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.
Is the ordering of the cases arbitrary?