[llvm] [SPIR-V] Diagnose function used as data pointer without SPV_INTEL_function_pointers (PR #207347)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 09:40:26 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)
----------------
MrSidims wrote:

@aobolensk current placement of guards for the extension check looks odd. Aren't there places early on the stack to look for function pointers and abort the lowering? 

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


More information about the llvm-commits mailing list