Move SCEVExpander::visitAddExpr out-of-line.
authorDan Gohman <gohman@apple.com>
Wed, 18 Jun 2008 16:37:11 +0000 (16:37 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 18 Jun 2008 16:37:11 +0000 (16:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52464 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 9a69b2416516e8097461ab76a8c515b3f0d5bc48..7f990d6a7eec59d5427a720f955bc79061941382 100644 (file)
@@ -111,15 +111,7 @@ namespace llvm {
       return CastInst::CreateSExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
     }
 
-    Value *visitAddExpr(SCEVAddExpr *S) {
-      Value *V = expand(S->getOperand(S->getNumOperands()-1));
-
-      // Emit a bunch of add instructions
-      for (int i = S->getNumOperands()-2; i >= 0; --i)
-        V = InsertBinop(Instruction::Add, V, expand(S->getOperand(i)),
-                        InsertPt);
-      return V;
-    }
+    Value *visitAddExpr(SCEVAddExpr *S);
 
     Value *visitMulExpr(SCEVMulExpr *S);
 
index e7bc3f25d1435256b00a670d2323a8b0404f9064..e32b21e623c75f6c4d99c43743f14a5545f16eef 100644 (file)
@@ -99,6 +99,16 @@ Value *SCEVExpander::InsertBinop(Instruction::BinaryOps Opcode, Value *LHS,
   return BinaryOperator::Create(Opcode, LHS, RHS, "tmp", InsertPt);
 }
 
+Value *SCEVExpander::visitAddExpr(SCEVAddExpr *S) {
+  Value *V = expand(S->getOperand(S->getNumOperands()-1));
+
+  // Emit a bunch of add instructions
+  for (int i = S->getNumOperands()-2; i >= 0; --i)
+    V = InsertBinop(Instruction::Add, V, expand(S->getOperand(i)),
+                    InsertPt);
+  return V;
+}
+    
 Value *SCEVExpander::visitMulExpr(SCEVMulExpr *S) {
   int FirstOp = 0;  // Set if we should emit a subtract.
   if (SCEVConstant *SC = dyn_cast<SCEVConstant>(S->getOperand(0)))