mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Don't do code sinking on unreachable blocks. It's unprofitable and hazardous.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100455 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -126,6 +126,11 @@ bool MachineSinking::ProcessBlock(MachineBasicBlock &MBB) {
|
||||
// Can't sink anything out of a block that has less than two successors.
|
||||
if (MBB.succ_size() <= 1 || MBB.empty()) return false;
|
||||
|
||||
// Don't bother sinking code out of unreachable blocks. In addition to being
|
||||
// unprofitable, it can also lead to infinite looping, because in an unreachable
|
||||
// loop there may be nowhere to stop.
|
||||
if (!DT->isReachableFromEntry(&MBB)) return false;
|
||||
|
||||
bool MadeChange = false;
|
||||
|
||||
// Walk the basic block bottom-up. Remember if we saw a store.
|
||||
|
Reference in New Issue
Block a user