Fix RegScavenger::forward() to work on basic blocks containing exactly
authorDan Gohman <gohman@apple.com>
Fri, 19 Dec 2008 00:45:13 +0000 (00:45 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 19 Dec 2008 00:45:13 +0000 (00:45 +0000)
one instruction.

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

include/llvm/CodeGen/RegisterScavenging.h

index 40dd66c06a77d8df144fe49570f3175588dfbff7..05e9e55e234344b63930c1c989cb74cb532809a7 100644 (file)
@@ -98,6 +98,7 @@ public:
   /// forward / backward - Move the internal MBB iterator and update register
   /// states until it has processed the specific iterator.
   void forward(MachineBasicBlock::iterator I) {
+    if (!Tracking && MBB->begin() != I) forward();
     while (MBBI != I) forward();
   }
   void backward(MachineBasicBlock::iterator I) {