[llvm] [SPIR-V] Fix crash on direct aggregate return of an intrinsic call result (PR #206491)
Arseniy Obolenskiy via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 1 02:02:27 PDT 2026
================
@@ -85,3 +85,16 @@ entry:
store <2 x i8> %zext_ofl, ptr %out_overflow
ret void
}
+
+; CHECK: OpFunction
+; CHECK: %[[#AR:]] = OpFunctionParameter %[[#Int]]
+; CHECK: %[[#BR:]] = OpFunctionParameter %[[#Int]]
+; CHECK: %[[#ResR:]] = OpIAdd %[[#Int]] %[[#AR]] %[[#BR]]
+; CHECK: %[[#Ins0:]] = OpCompositeInsert %[[#StructR:]] %[[#ResR]] %[[#]] 0
+; CHECK: %[[#Ins1:]] = OpCompositeInsert %[[#StructR]] %[[#]] %[[#Ins0]] 1
+; CHECK: OpReturnValue %[[#Ins1]]
+define spir_func { i32, i1 } @test_sadd_overflow_ret(i32 %a, i32 %b) {
+entry:
+ %res = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %a, i32 %b)
----------------
aobolensk wrote:
I added one
https://github.com/llvm/llvm-project/pull/206491
More information about the llvm-commits
mailing list