summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-10-07 06:33:09 +0000
committerAndrew Trick <atrick@apple.com>2011-10-07 06:33:09 +0000
commit35c9e51219942b7a5d0f95fd0b2abc7f79f58ba0 (patch)
treebedf79797262acb0845cb614ae10a9fe3da43307 /llvm/lib/CodeGen
parent4ef158335ba92e217786aca5a7d8acb2b5e09766 (diff)
downloadbcm5719-llvm-35c9e51219942b7a5d0f95fd0b2abc7f79f58ba0.tar.gz
bcm5719-llvm-35c9e51219942b7a5d0f95fd0b2abc7f79f58ba0.zip
PostRA scheduler fix. Clear stale loop dependencies.
Fixes <rdar://problem/10235725> llvm-svn: 141357
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/ScheduleDAGInstrs.cpp1
-rw-r--r--llvm/lib/CodeGen/ScheduleDAGInstrs.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index c5647fbc22a..34b8ab0b47f 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -134,6 +134,7 @@ static const Value *getUnderlyingObjectForInstr(const MachineInstr *MI,
}
void ScheduleDAGInstrs::StartBlock(MachineBasicBlock *BB) {
+ LoopRegs.Deps.clear();
if (MachineLoop *ML = MLI.getLoopFor(BB))
if (BB == ML->getLoopLatch()) {
MachineBasicBlock *Header = ML->getHeader();
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.h b/llvm/lib/CodeGen/ScheduleDAGInstrs.h
index 6e672f4b727..666bdf548c7 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.h
+++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.h
@@ -48,7 +48,8 @@ namespace llvm {
/// VisitLoop - Clear out any previous state and analyze the given loop.
///
void VisitLoop(const MachineLoop *Loop) {
- Deps.clear();
+ assert(Deps.empty() && "stale loop dependencies");
+
MachineBasicBlock *Header = Loop->getHeader();
SmallSet<unsigned, 8> LoopLiveIns;
for (MachineBasicBlock::livein_iterator LI = Header->livein_begin(),
OpenPOWER on IntegriCloud