[llvm-commits] [llvm] r52464 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolutionExpander.h lib/Analysis/ScalarEvolutionExpander.cpp
Dan Gohman
gohman at apple.com
Wed Jun 18 09:37:11 PDT 2008
Author: djg
Date: Wed Jun 18 11:37:11 2008
New Revision: 52464
URL: http://llvm.org/viewvc/llvm-project?rev=52464&view=rev
Log:
Move SCEVExpander::visitAddExpr 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=52464&r1=52463&r2=52464&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h Wed Jun 18 11:37:11 2008
@@ -111,15 +111,7 @@
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);
Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=52464&r1=52463&r2=52464&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Wed Jun 18 11:37:11 2008
@@ -99,6 +99,16 @@
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)))
More information about the llvm-commits
mailing list