Skip to content

Commit a8a0d8b

Browse files
bwlodarczsys-ce-bb
authored andcommitted
Ignore llvm.ubsantrap intrinsic (#2161)
It's the similar case as llvm.trap intrinsic - the preferred way is to ignore it in the translator. Original commit: KhronosGroup/SPIRV-LLVM-Translator@3d28e52
1 parent 22c845b commit a8a0d8b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -3548,6 +3548,7 @@ bool LLVMToSPIRVBase::isKnownIntrinsic(Intrinsic::ID Id) {
35483548
case Intrinsic::invariant_end:
35493549
case Intrinsic::dbg_label:
35503550
case Intrinsic::trap:
3551+
case Intrinsic::ubsantrap:
35513552
case Intrinsic::arithmetic_fence:
35523553
case Intrinsic::masked_gather:
35533554
case Intrinsic::masked_scatter:
@@ -4276,6 +4277,7 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II,
42764277
// llvm.trap intrinsic is not implemented. But for now don't crash. This
42774278
// change is pending the trap/abort intrinsic implementation.
42784279
case Intrinsic::trap:
4280+
case Intrinsic::ubsantrap:
42794281
// llvm.instrprof.* intrinsics are not supported
42804282
case Intrinsic::instrprof_increment:
42814283
case Intrinsic::instrprof_increment_step:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -o %t.spv
3+
; RUN: spirv-val %t.spv
4+
5+
target triple = "spir64-unknown-unknown"
6+
7+
define spir_func void @test_ubsantrap() {
8+
entry:
9+
call void @llvm.ubsantrap(i8 16)
10+
ret void
11+
}
12+
13+
declare void @llvm.ubsantrap(i8)

0 commit comments

Comments
 (0)