[llvm-commits] CVS: reopt/lib/Optimizations/RuntimeLICM.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Sat May 22 15:43:07 PDT 2004
Changes in directory reopt/lib/Optimizations:
RuntimeLICM.cpp updated: 1.2 -> 1.3
---
Log message:
Make this file compile again. Put code into llvm namespace.
Get rid of using std:: directives. Use DEBUG() for debugging msgs.
---
Diffs of the changes: (+10 -9)
Index: reopt/lib/Optimizations/RuntimeLICM.cpp
diff -u reopt/lib/Optimizations/RuntimeLICM.cpp:1.2 reopt/lib/Optimizations/RuntimeLICM.cpp:1.3
--- reopt/lib/Optimizations/RuntimeLICM.cpp:1.2 Thu Aug 21 15:55:17 2003
+++ reopt/lib/Optimizations/RuntimeLICM.cpp Sat May 22 15:41:41 2004
@@ -11,15 +11,14 @@
#include "llvm/iMemory.h"
#include "llvm/iPHINode.h"
#include "reopt/BinInterface/LLVMTrace.h"
-
+#include "Support/Debug.h"
#include <iostream>
-#include <vector>
#include <set>
+using namespace llvm;
-using std::vector;
-using std::set;
+namespace llvm {
-void RuntimeLICM(vector<BasicBlock *> &trace, LLVMTrace <race) {
+void RuntimeLICM(std::vector<BasicBlock *> &trace, LLVMTrace <race) {
//Put the trace in a set for faster searching
std::set<BasicBlock*> traceSet(trace.begin(), trace.end());
@@ -28,7 +27,7 @@
unsigned numLIC = 0;
//loop over all the basic blocks in my trace
- for(vector<BasicBlock *>::iterator T = trace.begin(), End = trace.end();
+ for(std::vector<BasicBlock *>::iterator T = trace.begin(), End = trace.end();
T != End; ++T) {
//loop over all the instructions in the basic block
@@ -57,14 +56,16 @@
}
if(isLoopInvariant) {
- std::cerr << "Loop Invariant Instruction: " << i << "\n";
+ DEBUG (std::cerr << "Loop Invariant Instruction: " << i << "\n";
+ ++numLIC);
//move to header block
ltrace.moveInstrToSec(&(*i), 0);
- ++numLIC;
}
}
}
}
- std::cerr << "Number Loop Invariant: " << numLIC << "\n";
+ DEBUG (std::cerr << "Number Loop Invariant: " << numLIC << "\n");
}
+
+} // end namespace llvm
More information about the llvm-commits
mailing list