If we know the trip count, we should make sure the interleave factor won't cause the vectorized loop to exceed it.
Improves one of the cases from PR42674
Paths
| Differential D65896
[LoopVectorize][X86] Clamp interleave factor if we have a known constant trip count that is less than VF*interleave ClosedPublic Authored by craig.topper on Aug 7 2019, 12:24 PM.
Details Summary If we know the trip count, we should make sure the interleave factor won't cause the vectorized loop to exceed it. Improves one of the cases from PR42674
Diff Detail Event Timeline
This revision is now accepted and ready to land.Aug 7 2019, 2:15 PM Closed by commit rL368215: [LoopVectorize][X86] Clamp interleave factor if we have a known constant trip… (authored by ctopper). · Explain WhyAug 7 2019, 2:44 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 213977 llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/X86/pr42674.ll
|
It might be slightly less code if we set MaxInterleaveCount = TC / VF; before line 5137, if TC > 0. TC / VF should always be >= 1. It might be worth adding an assertion to make sure we don't miss any cases.