[llvm] [SPIRV] fix `alloca` -> `OpVariable` lowering (PR #164175)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 04:09:33 PDT 2026


================
@@ -9,21 +9,24 @@
 ; CHECK-DAG: %[[TyInt64:.*]] = OpTypeInt 64 0
 ; CHECK-DAG: %[[TyFun:.*]] = OpTypeFunction %[[TyInt64]] %[[TyInt64]]
 ; CHECK-DAG: %[[TyPtrFunCodeSection:.*]] = OpTypePointer CodeSectionINTEL %[[TyFun]]
-; CHECK-DAG: %[[TyPtrPtrFunCodeSection:.*]] = OpTypePointer Function %[[TyPtrFunCodeSection]]
-; CHECK-DAG: %[[ConstFunFp:.*]] = OpConstantFunctionPointerINTEL %[[TyPtrFunCodeSection]] %[[DefFunFp:.*]]
 ; CHECK-DAG: %[[TyPtrFun:.*]] = OpTypePointer Function %[[TyFun]]
 ; CHECK-DAG: %[[TyPtrPtrFun:.*]] = OpTypePointer Function %[[TyPtrFun]]
+; CHECK-DAG: %[[TyInt8:.*]] = OpTypeInt 8 0
+; CHECK-DAG: %[[TyPtrInt8:.*]] = OpTypePointer Function %[[TyInt8]]
+; CHECK-DAG: %[[TyPtrPtrInt8:.*]] = OpTypePointer Function %[[TyPtrInt8]]
+; CHECK-DAG: %[[TyPtrPtrFunCodeSection:.*]] = OpTypePointer Function %[[TyPtrFunCodeSection]]
+; CHECK-DAG: %[[ConstFunFp:.*]] = OpConstantFunctionPointerINTEL %[[TyPtrFunCodeSection]] %[[DefFunFp:.*]]
 ; CHECK: OpFunction
-; CHECK: %[[Var:.*]] = OpVariable %[[TyPtrPtrFun]] Function
-; CHECK: %[[Cast:.*]] = OpBitcast %[[TyPtrPtrFunCodeSection]] %[[Var]]
-; CHECK: OpStore %[[Cast]] %[[ConstFunFp]]
-; CHECK: %[[FP:.*]] = OpLoad %[[TyPtrFun]] %[[Var]]
+; CHECK: %[[Var:.*]] = OpVariable %[[TyPtrPtrInt8]] Function
+; CHECK: %[[Cast1:.*]] = OpBitcast %[[TyPtrPtrFun]] %[[Var]]
+; CHECK: %[[Cast2:.*]] = OpBitcast %[[TyPtrPtrFunCodeSection]] %[[Cast1]]
----------------
jmmartinez wrote:

Some of this BC are a bit awkward. I have to double check this.

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


More information about the llvm-commits mailing list