[llvm] [SPIRV] Update the global registry when expanding function pointer (PR #183873)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 07:24:55 PST 2026


================
@@ -5341,6 +5341,8 @@ bool SPIRVInstructionSelector::selectGlobalValue(
         GR.add(ConstVal, MIB2);
         // mapping the function pointer to the used Function
         GR.recordFunctionPointer(&MIB2.getInstr()->getOperand(2), GVFun);
+        GR.assignSPIRVTypeToVReg(ResType, FuncVReg, *GR.CurMF);
+        GR.assignSPIRVTypeToVReg(ResType, NewReg, *GR.CurMF);
----------------
jmmartinez wrote:

I will open an issue. It's ok for me if we do not add the comment.

> I don't know if this is technical debt or a deliberate design decision.

It looks deliberate, but at the same time, the block-syntax tests that are related to this are marked with XFAIL since 2 years (related to #60133).

If these pointer operands can be freely replaced by 0; we could do that earlier at IR level and be more consistent in the rest of the backend.

#60133: I've assigned myself this issue. I should check the state of all of these and either fix them, change them, or remove them.

Thanks for taking a look into this!

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


More information about the llvm-commits mailing list