When FpMOVDs appeared in pairs, we were mistakenly skipping over the latter of
authorBrian Gaeke <gaeke@uiuc.edu>
Fri, 10 Dec 2004 04:42:45 +0000 (04:42 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Fri, 10 Dec 2004 04:42:45 +0000 (04:42 +0000)
each pair. I think this fixes that.

One of these days, I swear I'm going to get the hang of C++ iterators.
Really.

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

lib/Target/Sparc/FPMover.cpp
lib/Target/SparcV8/FPMover.cpp

index 6450f47f25725d44f6d45939222b223f27c645ed..49298c225b535c872d304f6af4e7fd6991a2cb27 100644 (file)
@@ -92,11 +92,13 @@ bool FPMover::runOnMachineBasicBlock (MachineBasicBlock &MBB) {
         DEBUG (std::cerr << "FPMover: new dest reg. is " << NewDestReg1
                          << "; inserted instr is: " << *MI2);
         ++NumFpMOVDs;
+        I = J;
+        --I;
       } else {
         MBB.erase (I);
         ++SkippedFpMOVDs;
+        I = J;
       }
-      I = J;
       Changed = true;
     }
   return Changed;
index 6450f47f25725d44f6d45939222b223f27c645ed..49298c225b535c872d304f6af4e7fd6991a2cb27 100644 (file)
@@ -92,11 +92,13 @@ bool FPMover::runOnMachineBasicBlock (MachineBasicBlock &MBB) {
         DEBUG (std::cerr << "FPMover: new dest reg. is " << NewDestReg1
                          << "; inserted instr is: " << *MI2);
         ++NumFpMOVDs;
+        I = J;
+        --I;
       } else {
         MBB.erase (I);
         ++SkippedFpMOVDs;
+        I = J;
       }
-      I = J;
       Changed = true;
     }
   return Changed;