[llvm] [AMDGPU] Handled G_UBSANTRAP GlobalIsel (PR #134492)

Tim Gymnich via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 5 06:39:00 PDT 2025


================
@@ -0,0 +1,7 @@
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -global-isel < %s
+; LLVM ERROR: cannot select: G_UBSANTRAP 0 (in function: ubsan_trap)
+
+define void @ubsan_trap() {
+  call void @llvm.ubsantrap(i8 0)
+  ret void
+}
----------------
tgymnich wrote:

For the test please have a look at: `llvm/test/CodeGen/AMDGPU/trap-abis.ll` and `llvm/test/CodeGen/AMDGPU/trap.ll`.

Also make sure to place your test in `test/CodeGen/AMDGPU/GlobalISel` if you are only testing GlobalISel.

https://github.com/llvm/llvm-project/pull/134492


More information about the llvm-commits mailing list