[llvm] [SPIR-V] Prevent generating OpTypePointer with OpTypeFunction pointee without extension (PR #207347)
Juan Manuel Martinez CaamaƱo via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 9 02:04:52 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)
----------------
jmmartinez wrote:
Wider question, but I don't have the whole context: why do we attempt to support function pointers when `SPV_INTEL_function_pointers` is not allowed?
I get why it could be useful, but is it really worth the pain we're inflicting on us by trying to hack around this extension not being present?
I would like to (at ir-level) replace all non-function call uses of functions as `poison` if the extension is not used.
@MrSidims @maarquitos14
https://github.com/llvm/llvm-project/pull/207347
More information about the llvm-commits
mailing list