[PATCH] D93229: [VectorCombine] allow peeking through GEPs when creating a vector load

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 05:48:00 PST 2020


spatel marked 2 inline comments as done.
spatel added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:145
   auto *MinVecTy = VectorType::get(ScalarTy, MinVecNumElts, false);
-  if (!isSafeToLoadUnconditionally(SrcPtr, MinVecTy, Align(1), DL, Load, &DT))
-    return false;
+  unsigned OffsetInBits = 0;
+  Align Alignment = Load->getAlign();
----------------
lebedev.ri wrote:
> And now that we already calculate `NumEltsInOffset`,
> shall we just use/record `NumEltsInOffset` instead of recalculating it from `OffsetInBits` later?
> (It them might use a better name, something like `ElementIndex` maybe)
Yes - no need to carry the offset as both an index and a bit value. Keeping both makes it harder to read. Thanks for the thorough review!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93229/new/

https://reviews.llvm.org/D93229



More information about the llvm-commits mailing list