mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Minor code cleanups.
llvm-svn: 74551
This commit is contained in:
parent
148d3bb9b4
commit
b3c5210779
@ -110,7 +110,9 @@ char ScalarEvolution::ID = 0;
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Implementation of the SCEV class.
|
// Implementation of the SCEV class.
|
||||||
//
|
//
|
||||||
|
|
||||||
SCEV::~SCEV() {}
|
SCEV::~SCEV() {}
|
||||||
|
|
||||||
void SCEV::dump() const {
|
void SCEV::dump() const {
|
||||||
print(errs());
|
print(errs());
|
||||||
errs() << '\n';
|
errs() << '\n';
|
||||||
@ -387,7 +389,6 @@ bool SCEVAddRecExpr::isLoopInvariant(const Loop *QueryLoop) const {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCEVAddRecExpr::print(raw_ostream &OS) const {
|
void SCEVAddRecExpr::print(raw_ostream &OS) const {
|
||||||
OS << "{" << *Operands[0];
|
OS << "{" << *Operands[0];
|
||||||
for (unsigned i = 1, e = Operands.size(); i != e; ++i)
|
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!");
|
"This is not a conversion to a SCEVable type!");
|
||||||
Ty = getEffectiveSCEVType(Ty);
|
Ty = getEffectiveSCEVType(Ty);
|
||||||
|
|
||||||
|
// Fold if the operand is constant.
|
||||||
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
|
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
|
||||||
return getConstant(
|
return getConstant(
|
||||||
cast<ConstantInt>(ConstantExpr::getTrunc(SC->getValue(), Ty)));
|
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!");
|
"This is not a conversion to a SCEVable type!");
|
||||||
Ty = getEffectiveSCEVType(Ty);
|
Ty = getEffectiveSCEVType(Ty);
|
||||||
|
|
||||||
|
// Fold if the operand is constant.
|
||||||
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
|
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
|
||||||
const Type *IntTy = getEffectiveSCEVType(Ty);
|
const Type *IntTy = getEffectiveSCEVType(Ty);
|
||||||
Constant *C = ConstantExpr::getZExt(SC->getValue(), IntTy);
|
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!");
|
"This is not a conversion to a SCEVable type!");
|
||||||
Ty = getEffectiveSCEVType(Ty);
|
Ty = getEffectiveSCEVType(Ty);
|
||||||
|
|
||||||
|
// Fold if the operand is constant.
|
||||||
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
|
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
|
||||||
const Type *IntTy = getEffectiveSCEVType(Ty);
|
const Type *IntTy = getEffectiveSCEVType(Ty);
|
||||||
Constant *C = ConstantExpr::getSExt(SC->getValue(), IntTy);
|
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
|
// The maximum backedge count is similar, except using the minimum start
|
||||||
// value and the maximum end value.
|
// value and the maximum end value.
|
||||||
const SCEV* MaxBECount = getBECount(MinStart, MaxEnd, Step);;
|
const SCEV* MaxBECount = getBECount(MinStart, MaxEnd, Step);
|
||||||
|
|
||||||
return BackedgeTakenInfo(BECount, MaxBECount);
|
return BackedgeTakenInfo(BECount, MaxBECount);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user