[LoopUnroll] Fold all exits based on known trip count/multiple
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 13 Jun 2021 14:55:17 +0000 (16:55 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 17 Jun 2021 18:58:34 +0000 (20:58 +0200)
commitf7c54c4603a2df8c0833f5ddc04a5e109bca1c14
treee39e1c5e4fd14c79696aff8a4675f0bdd17c4790
parentdc11d4e6be2455e666319e01bc1c79a3ba750fbf
[LoopUnroll] Fold all exits based on known trip count/multiple

Fold all exits based on known trip count/multiple information from
SCEV. Previously only the latch exit or the single exit were folded.

This doesn't yet eliminate ULO.TripCount and ULO.TripMultiple
entirely: They're still used to a) decide whether runtime unrolling
should be performed and b) for ORE remarks. However, the core
unrolling logic is independent of them now.

Differential Revision: https://reviews.llvm.org/D104203
llvm/lib/Transforms/Utils/LoopUnroll.cpp
llvm/test/Transforms/LoopUnroll/multiple-exits.ll
llvm/test/Transforms/LoopUnroll/nonlatchcondbr.ll