summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-15 01:58:56 +0000
committerChris Lattner <sabre@nondot.org>2007-01-15 01:58:56 +0000
commitb2f3e703bcde5833ff5910922f7a5313cc6b1c64 (patch)
treef91e80ddcdc4a5cbf989adde8d67e616c7aaea08
parent8f79df3cf9c91cb61aedd46b56dcdcd6d56b9d2d (diff)
downloadllvm-b2f3e703bcde5833ff5910922f7a5313cc6b1c64.tar.gz
llvm-b2f3e703bcde5833ff5910922f7a5313cc6b1c64.tar.bz2
llvm-b2f3e703bcde5833ff5910922f7a5313cc6b1c64.tar.xz
Update code to eliminate calls to isInteger, calling isIntegral instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33220 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpander.h6
-rw-r--r--lib/Analysis/ConstantRange.cpp2
-rw-r--r--lib/Analysis/ScalarEvolution.cpp27
-rw-r--r--lib/Support/ConstantRange.cpp2
4 files changed, 16 insertions, 21 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h
index 80e0a9d8cf..8a994b322a 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpander.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpander.h
@@ -60,7 +60,7 @@ namespace llvm {
/// loop (inserting one if there is none). A canonical induction variable
/// starts at zero and steps by one on each iteration.
Value *getOrInsertCanonicalInductionVariable(const Loop *L, const Type *Ty){
- assert((Ty->isInteger() || Ty->isFloatingPoint()) &&
+ assert((Ty->isIntegral() || Ty->isFloatingPoint()) &&
"Can only insert integer or floating point induction variables!");
SCEVHandle H = SCEVAddRecExpr::get(SCEVUnknown::getIntegerSCEV(0, Ty),
SCEVUnknown::getIntegerSCEV(1, Ty), L);
@@ -106,9 +106,9 @@ namespace llvm {
Value *expandInTy(SCEV *S, const Type *Ty) {
Value *V = expand(S);
if (Ty && V->getType() != Ty) {
- if (isa<PointerType>(Ty) && V->getType()->isInteger())
+ if (isa<PointerType>(Ty) && V->getType()->isIntegral())
return InsertCastOfTo(Instruction::IntToPtr, V, Ty);
- else if (Ty->isInteger() && isa<PointerType>(V->getType()))
+ else if (Ty->isIntegral() && isa<PointerType>(V->getType()))
return InsertCastOfTo(Instruction::PtrToInt, V, Ty);
else if (Ty->getPrimitiveSizeInBits() ==
V->getType()->getPrimitiveSizeInBits())
diff --git a/lib/Analysis/ConstantRange.cpp b/lib/Analysis/ConstantRange.cpp
index 378ae767ff..a1b5247595 100644
--- a/lib/Analysis/ConstantRange.cpp
+++ b/lib/Analysis/ConstantRange.cpp
@@ -225,7 +225,7 @@ bool ConstantRange::contains(ConstantInt *Val, bool isSigned) const {
/// subtract - Subtract the specified constant from the endpoints of this
/// constant range.
ConstantRange ConstantRange::subtract(ConstantInt *CI) const {
- assert(CI->getType() == getType() && getType()->isInteger() &&
+ assert(CI->getType() == getType() && getType()->isIntegral() &&
"Cannot subtract from different type range or non-integer!");
// If the set is empty or full, don't modify the endpoints.
if (Lower == Upper) return *this;
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index be661d9768..8f8b8f2c94 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -122,7 +122,7 @@ void SCEV::dump() const {
/// known to have. This method is only valid on integer SCEV objects.
ConstantRange SCEV::getValueRange() const {
const Type *Ty = getType();
- assert(Ty->isInteger() && "Can't get range for a non-integer SCEV!");
+ assert(Ty->isIntegral() && "Can't get range for a non-integer SCEV!");
// Default to a full range if no better information is available.
return ConstantRange(getType());
}
@@ -194,7 +194,7 @@ static ManagedStatic<std::map<std::pair<SCEV*, const Type*>,
SCEVTruncateExpr::SCEVTruncateExpr(const SCEVHandle &op, const Type *ty)
: SCEV(scTruncate), Op(op), Ty(ty) {
- assert(Op->getType()->isInteger() && Ty->isInteger() &&
+ assert(Op->getType()->isIntegral() && Ty->isIntegral() &&
"Cannot truncate non-integer value!");
assert(Op->getType()->getPrimitiveSizeInBits() > Ty->getPrimitiveSizeInBits()
&& "This is not a truncating conversion!");
@@ -220,7 +220,7 @@ static ManagedStatic<std::map<std::pair<SCEV*, const Type*>,
SCEVZeroExtendExpr::SCEVZeroExtendExpr(const SCEVHandle &op, const Type *ty)
: SCEV(scZeroExtend), Op(op), Ty(ty) {
- assert(Op->getType()->isInteger() && Ty->isInteger() &&
+ assert(Op->getType()->isIntegral() && Ty->isIntegral() &&
"Cannot zero extend non-integer value!");
assert(Op->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits()
&& "This is not an extending conversion!");
@@ -459,7 +459,7 @@ SCEVHandle SCEVUnknown::getIntegerSCEV(int Val, const Type *Ty) {
/// extended.
static SCEVHandle getTruncateOrZeroExtend(const SCEVHandle &V, const Type *Ty) {
const Type *SrcTy = V->getType();
- assert(SrcTy->isInteger() && Ty->isInteger() &&
+ assert(SrcTy->isIntegral() && Ty->isIntegral() &&
"Cannot truncate or zero extend with non-integer arguments!");
if (SrcTy->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
return V; // No conversion
@@ -1414,20 +1414,15 @@ SCEVHandle ScalarEvolutionsImpl::createSCEV(Value *V) {
break;
case Instruction::Trunc:
- // We don't handle trunc to bool yet.
- if (I->getType()->isInteger())
- return SCEVTruncateExpr::get(getSCEV(I->getOperand(0)), I->getType());
- break;
+ return SCEVTruncateExpr::get(getSCEV(I->getOperand(0)), I->getType());
case Instruction::ZExt:
- // We don't handle zext from bool yet.
- if (I->getOperand(0)->getType()->isInteger())
- return SCEVZeroExtendExpr::get(getSCEV(I->getOperand(0)), I->getType());
- break;
+ return SCEVZeroExtendExpr::get(getSCEV(I->getOperand(0)), I->getType());
case Instruction::BitCast:
// BitCasts are no-op casts so we just eliminate the cast.
- if (I->getType()->isInteger() && I->getOperand(0)->getType()->isInteger())
+ if (I->getType()->isIntegral() &&
+ I->getOperand(0)->getType()->isIntegral())
return getSCEV(I->getOperand(0));
break;
@@ -2191,7 +2186,7 @@ SCEVHandle ScalarEvolutionsImpl::HowFarToZero(SCEV *V, const Loop *L) {
}
}
}
- } else if (AddRec->isQuadratic() && AddRec->getType()->isInteger()) {
+ } else if (AddRec->isQuadratic() && AddRec->getType()->isIntegral()) {
// If this is a quadratic (3-term) AddRec {L,+,M,+,N}, find the roots of
// the quadratic equation to solve it.
std::pair<SCEVHandle,SCEVHandle> Roots = SolveQuadraticEquation(AddRec);
@@ -2319,7 +2314,7 @@ HowManyLessThans(SCEV *LHS, SCEV *RHS, const Loop *L) {
}
if (Cond == ICmpInst::ICMP_SLT) {
- if (PreCondLHS->getType()->isInteger()) {
+ if (PreCondLHS->getType()->isIntegral()) {
if (RHS != getSCEV(PreCondRHS))
return UnknownValue; // Not a comparison against 'm'.
@@ -2572,7 +2567,7 @@ void ScalarEvolution::print(std::ostream &OS, const Module* ) const {
OS << "Classifying expressions for: " << F.getName() << "\n";
for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
- if (I->getType()->isInteger()) {
+ if (I->getType()->isIntegral()) {
OS << *I;
OS << " --> ";
SCEVHandle SV = getSCEV(&*I);
diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp
index 378ae767ff..a1b5247595 100644
--- a/lib/Support/ConstantRange.cpp
+++ b/lib/Support/ConstantRange.cpp
@@ -225,7 +225,7 @@ bool ConstantRange::contains(ConstantInt *Val, bool isSigned) const {
/// subtract - Subtract the specified constant from the endpoints of this
/// constant range.
ConstantRange ConstantRange::subtract(ConstantInt *CI) const {
- assert(CI->getType() == getType() && getType()->isInteger() &&
+ assert(CI->getType() == getType() && getType()->isIntegral() &&
"Cannot subtract from different type range or non-integer!");
// If the set is empty or full, don't modify the endpoints.
if (Lower == Upper) return *this;