[PATCH] D69067: [LV] Reduce ingredient DU usage by ILV (NFC)

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 08:00:03 PDT 2019


Ayal added a comment.

Having special treatment for GEPs here does follow the unique way in which GEPs tolerate both scalar/invariant operands and/or vector operands.

Separate the VPWidenMemoryInstructionRecipe changes from those of VPWidenGEPRecipe, into two patches?



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3984
+    //       collectLoopScalars() and teach getVectorValue() to broadcast
+    //       the lane-zero scalar value.
+    auto *Clone = Builder.Insert(GEP->clone());
----------------
A GEP having only loop-invariant operands should be treated like any other uniform instruction, i.e., by a VPReplicateRecipe rather than a VPWidenGEPRecipe. This TODO is related to D68831 BTW.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6930
+    return true;
+  }
+
----------------
Would it be better and/or more in line with the current scheme, if this handling of GEPs by a designated Recipe took place outside the generic tryToWiden() which employs the default VPWidenRecipe?


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:594
     VPWidenSC,
+    VPWidenGEPSC,
   };
----------------
Keep in lex order.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:745
 
+/// A recipe for handling all phi nodes except for integer and FP inductions.
+class VPWidenGEPRecipe : public VPRecipeBase {
----------------
Update comment from phi to gep.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:750
+  bool IsPtrLoopInvariant;
+  SmallBitVector IsIndexLoopInvariant;
+
----------------
Holding a `LoopInvariantIndices` set would be worse than `IsIndexLoopInvariant` bit vector, right?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D69067





More information about the llvm-commits mailing list