diff options
author | YongKang Zhu <yongzhu@fb.com> | 2024-07-11 11:10:54 -0700 |
---|---|---|
committer | YongKang Zhu <yongzhu@fb.com> | 2024-07-11 11:12:53 -0700 |
commit | 546c09018a615388a36bdf898649fffbd2df529f (patch) | |
tree | a256243e4f6e0fa691845a5118e00f727c76928b /llvm/lib/CodeGen/MachineSink.cpp | |
parent | 5aed6d67e3f051262c67e3295476bf13cfc099c4 (diff) | |
download | llvm-546c09018a615388a36bdf898649fffbd2df529f.zip llvm-546c09018a615388a36bdf898649fffbd2df529f.tar.gz llvm-546c09018a615388a36bdf898649fffbd2df529f.tar.bz2 |
[MachineSink] Only add sink candidate if ToBB is a successor of fromBB
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 bbc5ab1..4d8de67 100644 --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -913,7 +913,7 @@ bool MachineSinking::isWorthBreakingCriticalEdge( auto Res = CEMergeCandidates.try_emplace(Key, From); // We wanted to sink the same register into the same block, consider it to // be profitable. - if (!Res.second) { + if (!Res.second && Res.first->second->isSuccessor(To)) { // Return the source block that was previously held off. DeferredFromBlock = Res.first->second; return true; |