aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-06-30 20:13:32 +0000
committerDan Gohman <gohman@apple.com>2009-06-30 20:13:32 +0000
commitc86c0df026b0a876a1bf9a6428c052052bba050b (patch)
treef5bfab04dabc3118c94a567c695d30e05547c8f8 /lib/Analysis
parent5d84bee971a317c8362add00c749a34ed42a474c (diff)
downloadexternal_llvm-c86c0df026b0a876a1bf9a6428c052052bba050b.zip
external_llvm-c86c0df026b0a876a1bf9a6428c052052bba050b.tar.gz
external_llvm-c86c0df026b0a876a1bf9a6428c052052bba050b.tar.bz2
Minor code cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 2b82778..4081562 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -110,7 +110,9 @@ char ScalarEvolution::ID = 0;
//===----------------------------------------------------------------------===//
// Implementation of the SCEV class.
//
+
SCEV::~SCEV() {}
+
void SCEV::dump() const {
print(errs());
errs() << '\n';
@@ -387,7 +389,6 @@ bool SCEVAddRecExpr::isLoopInvariant(const Loop *QueryLoop) const {
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 @@ const SCEV* ScalarEvolution::getTruncateExpr(const SCEV* Op,
"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 @@ const SCEV* ScalarEvolution::getZeroExtendExpr(const SCEV* Op,
"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 @@ const SCEV* ScalarEvolution::getSignExtendExpr(const SCEV* Op,
"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 @@ ScalarEvolution::HowManyLessThans(const SCEV *LHS, const SCEV *RHS,
// 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);
}