[llvm-branch-commits] [llvm] [DirectX] Add dx.op.debugBreak and use it to lower llvm.debugtrap (PR #241069)
Kaitlin Peng via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Nov 12 09:55:16 PST 2026
================
@@ -0,0 +1,18 @@
+; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.10-compute %s | FileCheck %s
+; RUN: llc -O0 -mtriple=dxil-pc-shadermodel6.10-compute %s -o - | FileCheck %s
+; RUN: llc -O2 -mtriple=dxil-pc-shadermodel6.10-compute %s -o - | FileCheck %s
+
+; CHECK-LABEL: main
+; The test is using two instances of the debugBreak to make sure they will
+; not get optimized away on -O2.
+; CHECK: call void @dx.op.debugBreak(i32 343)
+; CHECK: call void @dx.op.debugBreak(i32 343)
+
+define void @main() #0 {
----------------
kmpeng wrote:
nit: this reads slightly clearer to me, take it or leave it!
```suggestion
; The test is using two instances of the debugBreak to make sure they will
; not get optimized away on -O2.
; CHECK-LABEL: main
; CHECK: call void @dx.op.debugBreak(i32 343)
; CHECK: call void @dx.op.debugBreak(i32 343)
define void @main() #0 {
```
https://github.com/llvm/llvm-project/pull/241069
More information about the llvm-branch-commits
mailing list