summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
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
commitcbdf7e874ae5fa0ab93bc578473b01a099791098 (patch)
tree320754e7a9476961501219354cd3685757c70678 /llvm/lib/CodeGen
parent338de3ee561aeefec99255b8be55907d04a5c47b (diff)
downloadbcm5719-llvm-cbdf7e874ae5fa0ab93bc578473b01a099791098.tar.gz
bcm5719-llvm-cbdf7e874ae5fa0ab93bc578473b01a099791098.zip
Putting r117193 back except for the compile time cost. Rather than assuming fallthroughs uses all registers, just gather the union of all successor liveins.
llvm-svn: 117506
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/ScheduleDAGInstrs.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index 9b5d13b1200..abd68caf122 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/llvm/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);
+ }
}
}
OpenPOWER on IntegriCloud