[llvm] [Vectorizer] fix GEPs incorrectly marked as "inbounds" (PR #120730)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 06:43:34 PST 2025


================
@@ -8344,10 +8344,10 @@ VPRecipeBuilder::tryToWidenMemory(Instruction *I, ArrayRef<VPValue *> Operands,
         Ptr->getUnderlyingValue()->stripPointerCasts());
     VPSingleDefRecipe *VectorPtr;
     if (Reverse)
+      // N.B. we deliberately do pass getGEPNoWrapFlags here, because this
+      // transform can invalidate `inbounds`.
       VectorPtr = new VPReverseVectorPointerRecipe(
----------------
fmayer wrote:

yeah, sgtm. i had the same thought when i uploaded the diffs but then was gone for the holidays.

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


More information about the llvm-commits mailing list