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

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 08:08:15 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:

+1. If `SPV_INTEL_function_pointers` is not enabled and it's clear, what we translate a function pointer - abort the mission and don't try to enabled poison/undef. It's not backends duty to do so.

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


More information about the llvm-commits mailing list