[PATCH] D123541: [VPlan] Replace remaining use of needsScalarIV.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 09:10:40 PDT 2022


Ayal added a comment.

> Note that there are some test changes, because we now can correctly look through instructions like truncates to analyze the actual users.

this should be faster(?) ... and in some cases help clarify that a loop was actually not "vectorized" - when vector loop body is free of any vector instructions.



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8189
 
   bool NeedsScalarIV = LoopVectorizationPlanner::getDecisionAndClampRange(
       [&](ElementCount VF) {
----------------
NeedsScalarIV is now dead?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8201
       Range);
   bool NeedsScalarIVOnly = LoopVectorizationPlanner::getDecisionAndClampRange(
       [&](ElementCount VF) {
----------------
When/can NeedsScalarIVOnly also be discarded?


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:3036
+/// \p Def.
+bool scalarsUsed(VPValue *Def);
+
----------------
nit: name is a bit cryptic, but a better alternative doesn't come to mind.
Suffice to have a lambda next to the single user?


================
Comment at: llvm/test/Transforms/LoopVectorize/induction-multiple-uses-in-same-instruction.ll:25
+; CHECK-NEXT:    [[TMP7:%.*]] = icmp eq i64 [[INDEX_NEXT]], 100
+; CHECK-NEXT:    br i1 [[TMP7]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
 ; CHECK:       middle.block:
----------------
hmm, is this still considered to be vectorized by 2 and interleaved by 1, rather that the converse, contrary to the prescribed "-force-vector-width=2 -force-vector-interleave=1"


================
Comment at: llvm/test/Transforms/LoopVectorize/single-value-blend-phis.ll:311
+; CHECK:       exit:
+; CHECK-NEXT:    ret void
 ;
----------------
Is it important to add above CHECKs for the scalar loop?


================
Comment at: llvm/test/Transforms/LoopVectorize/single-value-blend-phis.ll:381
+; CHECK:       exit:
+; CHECK-NEXT:    ret void
 ;
----------------
ditto


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123541



More information about the llvm-commits mailing list