Special case common branch patterns in breakLoopBackedge (try 2)
authorPhilip Reames <listmail@philipreames.com>
Fri, 27 Aug 2021 17:12:15 +0000 (10:12 -0700)
committerPhilip Reames <listmail@philipreames.com>
Fri, 27 Aug 2021 17:27:16 +0000 (10:27 -0700)
commit6a82376012f519b6ef630a662d7b1e204e638eff
treebf107a031a0cf5e380c855a1761454f665f0079f
parent6734018041e408fe3cad13f2782d8048437de405
Special case common branch patterns in breakLoopBackedge (try 2)

Changes since aec08e:
* Adjust placement of a closing brace so that the general case actually runs.  Turns out we had *no* coverage of the switch case.  I added one in eae90fd.
* Drop .llvm.loop.* metadata from the new branch as there is no longer a loop to annotate.

Original commit message:

This special cases an unconditional latch and a conditional branch latch exit to improve codegen and test readability. I am hoping to reuse this function in the runtime unroll code, but without this change, the test diffs are far too complex to assess.
llvm/lib/Transforms/Utils/LoopUtils.cpp
llvm/test/Transforms/IndVarSimplify/exit_value_test2.ll
llvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
llvm/test/Transforms/LoopDeletion/loops-with-irreducible-subloops.ll
llvm/test/Transforms/LoopDeletion/noop-loops-with-subloops.ll
llvm/test/Transforms/LoopDeletion/pr49967.ll
llvm/test/Transforms/LoopDeletion/unreachable-loops.ll
llvm/test/Transforms/LoopDeletion/zero-btc.ll