[LV] Avoid needless fold tail
authorGil Rapaport <gil.rapaport@intel.com>
Tue, 15 Dec 2020 20:47:12 +0000 (22:47 +0200)
committerGil Rapaport <gil.rapaport@intel.com>
Tue, 22 Dec 2020 08:25:20 +0000 (10:25 +0200)
commita56280094e08792516b035390a946ea337a27b97
tree8d82b0af2a6ca7e883269c58117315074749dccf
parent34958d11c3457c8e05bbe2b31d5e013c04aecb55
[LV] Avoid needless fold tail

When the trip-count is provably divisible by the maximal/chosen VF, folding the
loop's tail during vectorization is redundant. This commit extends the existing
test for constant trip-counts to any trip-count known to be divisible by
maximal/selected VF by SCEV.

Differential Revision: https://reviews.llvm.org/D93615
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/dont-fold-tail-for-const-TC.ll [new file with mode: 0644]
llvm/test/Transforms/LoopVectorize/dont-fold-tail-for-divisible-TC.ll [new file with mode: 0644]