As a temporary workaround for post-RA not handling DebugValue instructions,
authorBob Wilson <bob.wilson@apple.com>
Sat, 17 Apr 2010 00:49:11 +0000 (00:49 +0000)
committerBob Wilson <bob.wilson@apple.com>
Sat, 17 Apr 2010 00:49:11 +0000 (00:49 +0000)
just remove them all.  Radar 7873207 (working around the root problem of
Radar 7759363).

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

lib/CodeGen/PostRASchedulerList.cpp

index 38abcb42b0a2c0b31300a22408db6e8971209685..79a25efd978afe7fb34e52baeee3a3a23681f6b0 100644 (file)
@@ -265,6 +265,17 @@ bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
     // Initialize register live-range state for scheduling in this block.
     Scheduler.StartBlock(MBB);
 
+    // FIXME: Temporary workaround for <rdar://problem/7759363>: The post-RA
+    // scheduler has some sort of problem with DebugValue instructions that
+    // causes an assertion in LeaksContext.h to fail occasionally.  Just
+    // remove all those instructions for now.
+    for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
+         I != E; ) {
+      MachineInstr *MI = &*I++;
+      if (MI->isDebugValue())
+        MI->eraseFromParent();
+    }
+
     // Schedule each sequence of instructions not interrupted by a label
     // or anything else that effectively needs to shut down scheduling.
     MachineBasicBlock::iterator Current = MBB->end();