[llvm-commits] [llvm] r74551 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Dan Gohman
gohman at apple.com
Tue Jun 30 13:13:32 PDT 2009
Author: djg
Date: Tue Jun 30 15:13:32 2009
New Revision: 74551
URL: http://llvm.org/viewvc/llvm-project?rev=74551&view=rev
Log:
Minor code cleanups.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=74551&r1=74550&r2=74551&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Jun 30 15:13:32 2009
@@ -110,7 +110,9 @@
//===----------------------------------------------------------------------===//
// Implementation of the SCEV class.
//
+
SCEV::~SCEV() {}
+
void SCEV::dump() const {
print(errs());
errs() << '\n';
@@ -387,7 +389,6 @@
return true;
}
-
void SCEVAddRecExpr::print(raw_ostream &OS) const {
OS << "{" << *Operands[0];
for (unsigned i = 1, e = Operands.size(); i != e; ++i)
@@ -743,6 +744,7 @@
"This is not a conversion to a SCEVable type!");
Ty = getEffectiveSCEVType(Ty);
+ // Fold if the operand is constant.
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
return getConstant(
cast<ConstantInt>(ConstantExpr::getTrunc(SC->getValue(), Ty)));
@@ -787,6 +789,7 @@
"This is not a conversion to a SCEVable type!");
Ty = getEffectiveSCEVType(Ty);
+ // Fold if the operand is constant.
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
const Type *IntTy = getEffectiveSCEVType(Ty);
Constant *C = ConstantExpr::getZExt(SC->getValue(), IntTy);
@@ -882,6 +885,7 @@
"This is not a conversion to a SCEVable type!");
Ty = getEffectiveSCEVType(Ty);
+ // Fold if the operand is constant.
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
const Type *IntTy = getEffectiveSCEVType(Ty);
Constant *C = ConstantExpr::getSExt(SC->getValue(), IntTy);
@@ -4241,7 +4245,7 @@
// The maximum backedge count is similar, except using the minimum start
// value and the maximum end value.
- const SCEV* MaxBECount = getBECount(MinStart, MaxEnd, Step);;
+ const SCEV* MaxBECount = getBECount(MinStart, MaxEnd, Step);
return BackedgeTakenInfo(BECount, MaxBECount);
}
More information about the llvm-commits
mailing list