mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Move SCEVExpander::getOrInsertCanonicalInductionVariable out of line.
llvm-svn: 72949
This commit is contained in:
parent
ee407d25ca
commit
856e18c047
@ -60,12 +60,7 @@ namespace llvm {
|
||||
/// canonical induction variable of the specified type for the specified
|
||||
/// loop (inserting one if there is none). A canonical induction variable
|
||||
/// starts at zero and steps by one on each iteration.
|
||||
Value *getOrInsertCanonicalInductionVariable(const Loop *L, const Type *Ty){
|
||||
assert(Ty->isInteger() && "Can only insert integer induction variables!");
|
||||
SCEVHandle H = SE.getAddRecExpr(SE.getIntegerSCEV(0, Ty),
|
||||
SE.getIntegerSCEV(1, Ty), L);
|
||||
return expand(H);
|
||||
}
|
||||
Value *getOrInsertCanonicalInductionVariable(const Loop *L, const Type *Ty);
|
||||
|
||||
/// addInsertedValue - Remember the specified instruction as being the
|
||||
/// canonical form for the specified SCEV.
|
||||
|
@ -644,3 +644,16 @@ Value *SCEVExpander::expand(const SCEV *S) {
|
||||
InsertedExpressions[S] = V;
|
||||
return V;
|
||||
}
|
||||
|
||||
/// getOrInsertCanonicalInductionVariable - This method returns the
|
||||
/// canonical induction variable of the specified type for the specified
|
||||
/// loop (inserting one if there is none). A canonical induction variable
|
||||
/// starts at zero and steps by one on each iteration.
|
||||
Value *
|
||||
SCEVExpander::getOrInsertCanonicalInductionVariable(const Loop *L,
|
||||
const Type *Ty) {
|
||||
assert(Ty->isInteger() && "Can only insert integer induction variables!");
|
||||
SCEVHandle H = SE.getAddRecExpr(SE.getIntegerSCEV(0, Ty),
|
||||
SE.getIntegerSCEV(1, Ty), L);
|
||||
return expand(H);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user