From 8ee6a2fb16c5e559d09dd6ef0b2a8816528f8e0a Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Fri, 10 Dec 2004 04:42:45 +0000 Subject: [PATCH] When FpMOVDs appeared in pairs, we were mistakenly skipping over the latter of 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 | 4 +++- lib/Target/SparcV8/FPMover.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Target/Sparc/FPMover.cpp b/lib/Target/Sparc/FPMover.cpp index 6450f47f257..49298c225b5 100644 --- a/lib/Target/Sparc/FPMover.cpp +++ b/lib/Target/Sparc/FPMover.cpp @@ -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; diff --git a/lib/Target/SparcV8/FPMover.cpp b/lib/Target/SparcV8/FPMover.cpp index 6450f47f257..49298c225b5 100644 --- a/lib/Target/SparcV8/FPMover.cpp +++ b/lib/Target/SparcV8/FPMover.cpp @@ -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;