[LoopPredication] Insert assumes of conditions of predicated guards
authorDmitry Makogon <d.makogon@g.nsu.ru>
Thu, 6 Oct 2022 09:30:48 +0000 (16:30 +0700)
committerDmitry Makogon <d.makogon@g.nsu.ru>
Fri, 7 Oct 2022 09:10:24 +0000 (16:10 +0700)
commit8307f6c854b64d00bac3d621917ff11bec1afb32
tree762edb8a030c1527dd9f982693a80a14709619fa
parentb56ef7519f41a051959d2dec3285f158780262a7
[LoopPredication] Insert assumes of conditions of predicated guards

As LoopPredication performs non-equivalent transforms removing some
checks from loops, other passes may not be able to perform transforms
they'd be able to do if the checks were left in loops.

This patch makes LoopPredication insert assumes of the replaced
conditions either after a guard call or in the true block of
widenable condition branch.

Differential Revision: https://reviews.llvm.org/D135354
llvm/lib/Transforms/Scalar/LoopPredication.cpp
llvm/test/Transforms/LoopPredication/assumes.ll
llvm/test/Transforms/LoopPredication/basic.ll
llvm/test/Transforms/LoopPredication/basic_widenable_branch_guards.ll
llvm/test/Transforms/LoopPredication/invariant_load.ll
llvm/test/Transforms/LoopPredication/nested.ll
llvm/test/Transforms/LoopPredication/profitability.ll
llvm/test/Transforms/LoopPredication/reverse.ll
llvm/test/Transforms/LoopPredication/visited.ll
llvm/test/Transforms/LoopPredication/widened.ll