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

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 4 05:58:41 PDT 2023


Ayal added a comment.
Herald added a subscriber: wangpc.

In D154261#4468894 <https://reviews.llvm.org/D154261#4468894>, @fhahn wrote:

> Rebase on top of e561edaaa56c9a8818d546774b141dead7224b50 <https://reviews.llvm.org/rGe561edaaa56c9a8818d546774b141dead7224b50> which updates the test in pr56319-vector-exit-cond-optimization-epilogue-vectorization.ll so it keeps testing for the original issue.

Ah, the original issue of pr56319 was to ensure that the epilog loop leaves at-least one iteration for the scalar loop (or actually epilogVF iterations) rather than vectorizing all remaining iterations? An odd trip count of 39 will always end up with a last scalar iteration, due to main and epilog VF's being even. Perhaps a trip count of 48 with (forced?) main-loop VF of 32 and epilog-loop VF of 8 should ensure the epilog loop runs only once.



================
Comment at: llvm/test/Transforms/LoopVectorize/X86/limit-vf-by-tripcount.ll:286
 
 define void @limit_main_loop_vf_to_avoid_epilogue_vectorization(ptr noalias %src, ptr noalias %dst) {
 ; CHECK-LABEL: @limit_main_loop_vf_to_avoid_epilogue_vectorization(
----------------
nit: name of test is a bit misleading, the VF of the main loop is limited to avoid excessive values rather than avoiding epilog vectorization.


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