PostRA scheduler fix. Clear stale loop dependencies.
authorAndrew Trick <atrick@apple.com>
Fri, 7 Oct 2011 06:33:09 +0000 (06:33 +0000)
committerAndrew Trick <atrick@apple.com>
Fri, 7 Oct 2011 06:33:09 +0000 (06:33 +0000)
Fixes <rdar://problem/10235725>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141357 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ScheduleDAGInstrs.cpp
lib/CodeGen/ScheduleDAGInstrs.h

index c5647fbc22a3a7820dec1bafee3f44ee4cc8bddc..34b8ab0b47f25341bb860b44b71b0c740680067c 100644 (file)
@@ -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();
index 6e672f4b727281ac925af9de8da692a98f470c37..666bdf548c718c4cdb788e92f682691c31972dfd 100644 (file)
@@ -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(),