static Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS,
Value *RHS, Instruction *&InsertPt);
protected:
- Value *expand(SCEV *S) {
- // Check to see if we already expanded this.
- std::map<SCEVHandle, Value*>::iterator I = InsertedExpressions.find(S);
- if (I != InsertedExpressions.end())
- return I->second;
-
- Value *V = visit(S);
- InsertedExpressions[S] = V;
- return V;
- }
-
+ Value *expand(SCEV *S);
+
Value *visitConstant(SCEVConstant *S) {
return S->getValue();
}
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/ScalarEvolutionExpander.h"
+#include "llvm/Analysis/ScalarEvolution.h"
using namespace llvm;
//===----------------------------------------------------------------------===//
return expand(V);
}
+
+Value *SCEVExpander::expand(SCEV *S) {
+ // Check to see if we already expanded this.
+ std::map<SCEVHandle, Value*>::iterator I = InsertedExpressions.find(S);
+ if (I != InsertedExpressions.end())
+ return I->second;
+
+ Value *V = visit(S);
+ InsertedExpressions[S] = V;
+ return V;
+}
+