summaryrefslogtreecommitdiff
path: root/lib/CodeGen/ScheduleDAGInstrs.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-10-27 23:17:17 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-10-27 23:17:17 +0000
commitde5fa932b9bc0eebe803c9549586bf512eeb12f9 (patch)
treebed7c6c922ce10b21bcd886e34a61aadf780584e /lib/CodeGen/ScheduleDAGInstrs.cpp
parent7e3383c007f53b3a00675af225e428cb66ddf404 (diff)
downloadllvm-de5fa932b9bc0eebe803c9549586bf512eeb12f9.tar.gz
llvm-de5fa932b9bc0eebe803c9549586bf512eeb12f9.tar.bz2
llvm-de5fa932b9bc0eebe803c9549586bf512eeb12f9.tar.xz
Putting r117193 back except for the compile time cost. Rather than assuming fallthroughs uses all registers, just gather the union of all successor liveins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117506 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ScheduleDAGInstrs.cpp')
-rw-r--r--lib/CodeGen/ScheduleDAGInstrs.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/CodeGen/ScheduleDAGInstrs.cpp b/lib/CodeGen/ScheduleDAGInstrs.cpp
index 9b5d13b120..abd68caf12 100644
--- a/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -168,9 +168,16 @@ void ScheduleDAGInstrs::AddSchedBarrierDeps() {
}
} else {
// For others, e.g. fallthrough, conditional branch, assume the exit
- // uses all the registers.
- // FIXME: This causes too much compile time regression. We need to compute
- // liveout instead.
+ // uses all the registers that are livein to the successor blocks.
+ SmallSet<unsigned, 8> Seen;
+ for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
+ SE = BB->succ_end(); SI != SE; ++SI)
+ for (MachineBasicBlock::livein_iterator I = (*SI)->livein_begin(),
+ E = (*SI)->livein_end(); I != E; ++I) {
+ unsigned Reg = *I;
+ if (Seen.insert(Reg))
+ Uses[Reg].push_back(&ExitSU);
+ }
}
}