[PATCH] D154261: [LV] Consider if scalar epilogue is required in getMaximizedVFForTarget.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 05:36:49 PDT 2023


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


================
Comment at: llvm/test/Transforms/LoopVectorize/X86/pr56319-vector-exit-cond-optimization-epilogue-vectorization.ll:9-10
+; vector loop will be executed, followed by 2 iterations of the vector epilogue,
+; followed by a final iteration of the scalar loop, because the interleave group
+; requires to execute at least one scalar iteration.
 define void @pr56319(ptr noalias %src, ptr noalias %dst) {
----------------
Ayal wrote:
> The scalar loop will get to run the final iteration in any case, due to the trip-count being odd, regardless of any interleave group requiring it (aka red herring).
Adjusted in the committed version.


================
Comment at: llvm/test/Transforms/LoopVectorize/X86/pr56319-vector-exit-cond-optimization-epilogue-vectorization.ll:30
 ; CHECK-NEXT:    [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 32
 ; CHECK-NEXT:    [[TMP5:%.*]] = icmp eq i64 [[INDEX_NEXT]], 32
 ; CHECK-NEXT:    br i1 [[TMP5]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
----------------
Ayal wrote:
> (Just noting that we're refraining from optimizing this single iteration main loop with an unconditional branch exiting to middle block, because that would also cause the double iteration epilog loop to bail out after its first iteration.)
Exactly


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154261



More information about the llvm-commits mailing list