[llvm] [SPIR-V] Prevent generating OpTypePointer with OpTypeFunction pointee without extension (PR #207347)

Marcos Maronas via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 08:02:50 PDT 2026


================
@@ -258,7 +258,9 @@ static void insertBitcasts(MachineFunction &MF, SPIRVGlobalRegistry *GR,
       Register Source = MI.getOperand(2).getReg();
       Type *ElemTy = getMDOperandAsType(MI.getOperand(3).getMetadata(), 0);
       auto SC =
-          isa<FunctionType>(ElemTy)
+          isa<FunctionType>(ElemTy) &&
+                  ST->canUseExtension(
+                      SPIRV::Extension::SPV_INTEL_function_pointers)
----------------
maarquitos14 wrote:

I don't have the context either. I think what you suggest is reasonable, but I don't know the full story.

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


More information about the llvm-commits mailing list