[llvm-commits] [llvm] r72949 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolutionExpander.h lib/Analysis/ScalarEvolutionExpander.cpp

Dan Gohman gohman at apple.com
Fri Jun 5 09:35:53 PDT 2009


Author: djg
Date: Fri Jun  5 11:35:53 2009
New Revision: 72949

URL: http://llvm.org/viewvc/llvm-project?rev=72949&view=rev
Log:
Move SCEVExpander::getOrInsertCanonicalInductionVariable out of line.

Modified:
    llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h
    llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp

Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h?rev=72949&r1=72948&r2=72949&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h Fri Jun  5 11:35:53 2009
@@ -60,12 +60,7 @@
     /// 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.

Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=72949&r1=72948&r2=72949&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Fri Jun  5 11:35:53 2009
@@ -644,3 +644,16 @@
   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);
+}





More information about the llvm-commits mailing list