[PATCH] D70865: [LV] VPValues for memory operation pointers (NFCI)

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 30 12:14:16 PST 2019


rengolin added a comment.

As far as I can see, this shouldn't introduce behavioural changes and does add some nice cleanups.

But I'd be more comfortable with some other pair of eyes looking over it, as I'm rusty with VPlan code.

Also, some nits inline.

Thanks!



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:487
   /// operations if \p BlockInMask is non-null.
-  void vectorizeMemoryInstruction(Instruction *Instr,
-                                  VectorParts *BlockInMask = nullptr);
+  void vectorizeMemoryInstruction(Instruction *Instr, VPTransformState &State,
+                                  VPValue *Addr,
----------------
nit: keep the same formatting as above (or vice versa)


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2201
 
-  bool InBounds = false;
-  if (auto *gep = dyn_cast<GetElementPtrInst>(Ptr->stripPointerCasts()))
-    InBounds = gep->isInBounds();
-
   for (unsigned Part = 0; Part < UF; Part++) {
+    Value *NewPtr = State.get(Addr, {Part, 0});
----------------
What's the difference between UF and State.UF? This looks confusing now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70865





More information about the llvm-commits mailing list