[LV] Use SCEV to check if the trip count <= VF * UF.
authorFlorian Hahn <flo@fhahn.com>
Sat, 24 Dec 2022 18:33:36 +0000 (18:33 +0000)
committerFlorian Hahn <flo@fhahn.com>
Sat, 24 Dec 2022 18:34:54 +0000 (18:34 +0000)
commit9758242046b3cdce6fb713acb6d3f5bfaa933a47
tree0facfc18d8039ddaff6980570f3deba2246b0a28
parentec99bf24804b1de22fb05d8153a4d5fc1df234fc
[LV] Use SCEV to check if the trip count <= VF * UF.

Just comparing constant trip counts causes LV to miss cases where the
vector loop body only executes once.

The motivation for this is to remove the need for unrolling to remove
vector loop back-edges, if the body only executes once in more cases.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D133017
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
llvm/test/Transforms/LoopVectorize/vector-loop-backedge-elimination.ll