aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-09-02 09:09:21 +0200
committerGitHub <noreply@github.com>2024-09-02 09:09:21 +0200
commitf044564db1cbc588d0cad4f953d38f6c787dadd4 (patch)
tree8f7018c2c5bd3e598540f16e389b8b59ae1824ea /llvm/lib/Support/APInt.cpp
parentd2ce9dc85e5d94e19a69d4a72e7b9197447d480a (diff)
downloadllvm-f044564db1cbc588d0cad4f953d38f6c787dadd4.zip
llvm-f044564db1cbc588d0cad4f953d38f6c787dadd4.tar.gz
llvm-f044564db1cbc588d0cad4f953d38f6c787dadd4.tar.bz2
[InstCombine] Make backedge check in op of phi transform more precise (#106075)
The op of phi transform wants to prevent moving an operation across a backedge, as this may lead to an infinite combine loop. Currently, this is done using isPotentiallyReachable(). The problem with that is that all blocks inside a loop are reachable from each other. This means that the op of phi transform is effectively completely disabled for code inside loops, even when it's not actually operating on a loop phi (just a phi that happens to be in a loop). Fix this by explicitly computing the backedges inside the function instead. Do this via RPOT, which is a bit more efficient than using FindFunctionBackedges() (which does it without any pre-computed analyses). For irreducible cycles, there may be multiple possible choices of backedge, and this just picks one of them. This is still sufficient to prevent combine loops. This also removes the last use of LoopInfo in InstCombine -- I'll drop the analysis in a followup.
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
0 files changed, 0 insertions, 0 deletions