Move SCEVExpander::getOrInsertCanonicalInductionVariable out of line.
authorDan Gohman <gohman@apple.com>
Fri, 5 Jun 2009 16:35:53 +0000 (16:35 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 5 Jun 2009 16:35:53 +0000 (16:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72949 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/ScalarEvolutionExpander.h
lib/Analysis/ScalarEvolutionExpander.cpp

index 7e0de47dc4f3b291077592ba17d7c8326b995845..b40fbf06f9c871565f1d911e178afdfc7daff047 100644 (file)
@@ -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.
index 7ba8268b508aa33cbf387da39d4f6f12a3556e16..ef77e46fc99ab6e2fad869ae4177ab4ff70a596f 100644 (file)
@@ -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);
+}