[LoopUnrollRuntime] Allow indirect transition to deopt non-latch exit blocks
authorYevgeny Rouban <yrouban@azul.com>
Thu, 8 Jun 2023 09:32:12 +0000 (16:32 +0700)
committerYevgeny Rouban <yrouban@azul.com>
Mon, 19 Jun 2023 04:10:01 +0000 (11:10 +0700)
commit1ebbbf1614cfdbf6d78f4f2a665cdea9cbb2beb8
treea17d12194ecbc20174beee6d96c895e5f89db636
parent2d8044ee8b19f23e0a7fe5cd35876515d0d1d72e
[LoopUnrollRuntime] Allow indirect transition to deopt non-latch exit blocks

Relax condition on runtime trip count unrolling loops with 1 non-latch exit
that leads to a deop block.

There are cases when the deopt blocks are common exits for different loops.
LoopSimplify pass splits such edges to the common deopting blocks to make
sure that all exit nodes of the loop only have predecessors that are inside
of the loop (See simplifyOneLoop()). This breaks the current condition for
unrolling. This patch allows the split transitive blocks that still lead to
the deopting blocks.

Differential Revision: https://reviews.llvm.org/D152639
llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
llvm/test/Transforms/LoopUnroll/runtime-multiexit-heuristic.ll