#include "Support/Debug.h"
#include "Support/DepthFirstIterator.h"
#include "Support/Statistic.h"
+#include "Support/STLExtras.h"
#include <algorithm>
#include <set>
using namespace llvm;
continue; // Efficiently ignore non-fp insts!
MachineInstr *PrevMI = 0;
- if (I != BB.begin()) {
- MachineBasicBlock::iterator tmp = I;
- --tmp;
- PrevMI = tmp;
- }
+ if (I != BB.begin())
+ PrevMI = prior(I);
++NumFP; // Keep track of # of pseudo instrs
DEBUG(std::cerr << "\nFPInst:\t";
}
// Print out all of the instructions expanded to if -debug
- DEBUG(if (&*I == PrevMI) {
- std::cerr<< "Just deleted pseudo instruction\n";
- } else {
- MachineBasicBlock::iterator Start = I;
- // Rewind to first instruction newly inserted.
- while (Start != BB.begin() &&
- --Start != MachineBasicBlock::iterator(PrevMI));
- ++Start;
- std::cerr << "Inserted instructions:\n\t";
- Start->print(std::cerr, MF.getTarget());
- while (++Start != I); ++Start;
- }
- dumpStack();
- );
+ DEBUG(
+ MachineBasicBlock::iterator PrevI(PrevMI);
+ if (I == PrevI) {
+ std::cerr<< "Just deleted pseudo instruction\n";
+ } else {
+ MachineBasicBlock::iterator Start = I;
+ // Rewind to first instruction newly inserted.
+ while (Start != BB.begin() && prior(Start) != PrevI) --Start;
+ std::cerr << "Inserted instructions:\n\t";
+ Start->print(std::cerr, MF.getTarget());
+ while (++Start != next(I));
+ }
+ dumpStack();
+ );
Changed = true;
}