#include "llvm/Transforms/Scalar.h"
#include "llvm/Analysis/InductionVariable.h"
#include "llvm/Analysis/LoopInfo.h"
-#include "llvm/Analysis/Writer.h"
#include "llvm/iPHINode.h"
#include "llvm/iOther.h"
#include "llvm/Type.h"
#include "llvm/Support/CFG.h"
#include "Support/STLExtras.h"
#include "Support/StatisticReporter.h"
-#include <iostream>
static Statistic<> NumRemoved ("indvars\t\t- Number of aux indvars removed");
static Statistic<> NumInserted("indvars\t\t- Number of cannonical indvars added");
for (unsigned i = 0; i < IndVars.size(); ++i) {
InductionVariable *IV = &IndVars[i];
- DEBUG(std::cerr << IV);
+ DEBUG(IV->print(std::cerr));
// Don't modify the cannonical indvar or unrecognized indvars...
if (IV != Cannonical && IV->InductionType != InductionVariable::Unknown) {
namespace {
struct InductionVariableSimplify : public FunctionPass {
- const char *getPassName() const {
- return "Induction Variable Cannonicalize";
- }
-
virtual bool runOnFunction(Function &) {
LoopInfo &LI = getAnalysis<LoopInfo>();
AU.preservesCFG();
}
};
+ RegisterOpt<InductionVariableSimplify> X("indvars",
+ "Cannonicalize Induction Variables");
}
Pass *createIndVarSimplifyPass() {
return new InductionVariableSimplify();
}
-