[llvm] [SPIRV] Add support for pointers to functions with aggregate args/returns as global variables / constant initialisers (PR #169595)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 26 02:53:58 PST 2025


================
@@ -1062,9 +1071,10 @@ void SPIRVEmitIntrinsics::deduceOperandElementTypeFunctionPointer(
   if (!Op || !isPointerTy(Op->getType()))
     return;
   Ops.push_back(std::make_pair(Op, std::numeric_limits<unsigned>::max()));
-  FunctionType *FTy = CI->getFunctionType();
+  FunctionType *FTy = SPIRV::getOriginalFunctionType(*CI);
   bool IsNewFTy = false, IsIncomplete = false;
   SmallVector<Type *, 4> ArgTys;
+  unsigned ParmIdx = 0;
   for (Value *Arg : CI->args()) {
----------------
jmmartinez wrote:

Nitpick, but there is a `llvm::enumerate`.

It'd become:
```cpp
  for (auto [ParmIdx, Arg] : CI->args()) {
```

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


More information about the llvm-commits mailing list