[llvm] [SPIR-V] Lower vector-typed GEPs with more than 1 element in SPIRVEmitIntrinsics (PR #197101)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 7 13:04:07 PDT 2026


================
@@ -162,13 +162,25 @@ static SPIRVTypeInst getArgSPIRVType(const Function &F, unsigned ArgIdx,
   Type *OriginalArgType =
       SPIRV::getOriginalFunctionType(F)->getParamType(ArgIdx);
 
+  // Vector of untyped pointers: build with the deduced pointee instead of
+  // the default i8 (mismatches typed uses downstream).
+  Argument *Arg = F.getArg(ArgIdx);
+  if (auto *VTy = dyn_cast<FixedVectorType>(OriginalArgType);
+      VTy && isUntypedPointerTy(VTy->getElementType()))
+    if (Type *ElemTy = GR->findDeducedElementType(Arg))
----------------
MrSidims wrote:

I'd treat this as more than a missing test — I think the case is currently miscompiled, not just unverified. But we can skip it for now as it's not a regression from the PR.

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


More information about the llvm-commits mailing list