[llvm] [SPIR-V] Fix inttoptr type deduction with ptr.annotation (PR #189219)

Viktoria Maximova via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 09:31:48 PDT 2026


================
@@ -909,7 +909,13 @@ Type *SPIRVEmitIntrinsics::deduceElementTypeHelper(
                                           UnknownElemTypeI8);
     maybeAssignPtrType(Ty, I, RefTy, UnknownElemTypeI8);
   } else if (auto *Ref = dyn_cast<IntToPtrInst>(I)) {
-    maybeAssignPtrType(Ty, I, Ref->getDestTy(), UnknownElemTypeI8);
+    // Passing an untyped pointer to maybeAssignPtrType would record it as the
+    // pointee type, producing a pointer‑to‑pointer in SPIR-V (OpConvertUToPtr
----------------
vmaksimo wrote:

Just curious, if there is a way (or sense) to fix this thing inside `maybeAssignPtrType()` so it don't record pointer as a pointee type?
At first glance it looks like the same check just in other function, not sure about regressions though

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


More information about the llvm-commits mailing list