diff options
author | yozhu <101743168+yozhu@users.noreply.github.com> | 2024-07-12 16:39:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-13 01:39:27 +0200 |
commit | 7b135f7c0881ef0718c5c83e4d8556c5fdb32d86 (patch) | |
tree | 537ba17ea44b2753c978fb03a058ea55cb5fc95f /llvm/lib/CodeGen/MachineSink.cpp | |
parent | 76e37b1a08906620537440ebcd5162697079cba5 (diff) | |
download | llvm-7b135f7c0881ef0718c5c83e4d8556c5fdb32d86.zip llvm-7b135f7c0881ef0718c5c83e4d8556c5fdb32d86.tar.gz llvm-7b135f7c0881ef0718c5c83e4d8556c5fdb32d86.tar.bz2 |
[MachineSink] Check predecessor/successor relationship between two basic blocks involved in critical edge splitting (#98540)
Fix an issue in #97618 - if the two basic blocks involved are not
predecessor / successor to each other, treat the candidate as illegal
for critical edge splitting.
Closes #98477 (checked in test copied from its comment).
Diffstat (limited to 'llvm/lib/CodeGen/MachineSink.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineSink.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp index 8409c95..d782c8b 100644 --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -961,7 +961,7 @@ bool MachineSinking::isLegalToBreakCriticalEdge(MachineInstr &MI, MachineBasicBlock *ToBB, bool BreakPHIEdge) { // Avoid breaking back edge. From == To means backedge for single BB cycle. - if (!SplitEdges || FromBB == ToBB) + if (!SplitEdges || FromBB == ToBB || !FromBB->isSuccessor(ToBB)) return false; MachineCycle *FromCycle = CI->getCycle(FromBB); |