[PATCH] D95757: [LV] Replace some uses of VectorLoopValueMap with VPTransformState (NFC)

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 01:04:22 PST 2021


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4226
+void InnerLoopVectorizer::fixReduction(PHINode *Phi, VPTransformState &State,
+                                       VPlan &Plan) {
   // Get it's reduction variable descriptor.
----------------
gilr wrote:
> We could have VPTransformState hold a pointer to the plan being executed to save passing it separately. What do you think?
I think that's better! I updated the code. There are probably other places which can be updated as well to use the pointer in VPTransformState. I can update those in a separate commit.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4452
     Value *lastIncomingValue =
-      getOrCreateScalarValue(IncomingValue, { UF - 1, LastLane });
+        isa<Instruction>(IncomingValue) &&
+                OrigLoop->contains(cast<Instruction>(IncomingValue))
----------------
gilr wrote:
> Simpler to follow getOrCreateScalarValue() logic?
> `...= OrigLoop->isLoopInvariant(IncomingValue)) ? IncomingValue : State.get(...)`
That's much better, thanks! Updated the code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95757



More information about the llvm-commits mailing list