Make SCEVExpander::addInsertedValue able to accept Values, not just

Instructions.

llvm-svn: 70552
This commit is contained in:
Dan Gohman 2009-05-01 16:58:31 +00:00
parent d3aa4215ef
commit 719f7d5c86
1 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ namespace llvm {
ScalarEvolution &SE;
LoopInfo &LI;
std::map<SCEVHandle, Value*> InsertedExpressions;
std::set<Instruction*> InsertedInstructions;
std::set<Value*> InsertedValues;
BasicBlock::iterator InsertPt;
@ -50,7 +50,7 @@ namespace llvm {
/// inserted by the code rewriter. If so, the client should not modify the
/// instruction.
bool isInsertedInstruction(Instruction *I) const {
return InsertedInstructions.count(I);
return InsertedValues.count(I);
}
/// getOrInsertCanonicalInductionVariable - This method returns the
@ -66,9 +66,9 @@ namespace llvm {
/// addInsertedValue - Remember the specified instruction as being the
/// canonical form for the specified SCEV.
void addInsertedValue(Instruction *I, const SCEV *S) {
InsertedExpressions[S] = (Value*)I;
InsertedInstructions.insert(I);
void addInsertedValue(Value *V, const SCEV *S) {
InsertedExpressions[S] = V;
InsertedValues.insert(V);
}
void setInsertionPoint(BasicBlock::iterator NewIP) { InsertPt = NewIP; }