[llvm] [SimplifyCFG] Handle vector GEP in `passingValueIsAlwaysUndefined` (PR #142526)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 00:34:57 PDT 2025


================
@@ -8177,6 +8178,10 @@ static bool passingValueIsAlwaysUndefined(Value *V, Instruction *I, bool PtrValu
              NullPointerIsDefined(GEP->getFunction(),
                                   GEP->getPointerAddressSpace())))
           PtrValueMayBeModified = true;
+        // The type of GEP may differ from the type of base pointer.
+        if (V->getType() != GEP->getType())
+          V = ConstantVector::getSplat(
+              cast<VectorType>(GEP->getType())->getElementCount(), C);
----------------
nikic wrote:

Can we just bail out on vector GEP? The actual UB checks require pointers, right?

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


More information about the llvm-commits mailing list