summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-04-21 00:55:22 +0000
committerDan Gohman <gohman@apple.com>2009-04-21 00:55:22 +0000
commit413e91f4401c7d416315128bf059431cb1454a0a (patch)
treed26affbba968a0a7c28b85643924a822c2e64574 /llvm
parent3214d1232586f2474928a46ab272b0bc79cb3737 (diff)
downloadbcm5719-llvm-413e91f4401c7d416315128bf059431cb1454a0a.tar.gz
bcm5719-llvm-413e91f4401c7d416315128bf059431cb1454a0a.zip
Move some assertion checks so they can do more complete checking.
llvm-svn: 69643
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 151ea743126..2a6cc50c0ba 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -201,10 +201,6 @@ SCEVTruncateExpr::SCEVTruncateExpr(const SCEVHandle &op, const Type *ty)
assert((Op->getType()->isInteger() || isa<PointerType>(Op->getType())) &&
(Ty->isInteger() || isa<PointerType>(Ty)) &&
"Cannot truncate non-integer value!");
- assert((!Op->getType()->isInteger() || !Ty->isInteger() ||
- Op->getType()->getPrimitiveSizeInBits() >
- Ty->getPrimitiveSizeInBits()) &&
- "This is not a truncating conversion!");
}
SCEVTruncateExpr::~SCEVTruncateExpr() {
@@ -255,8 +251,6 @@ SCEVSignExtendExpr::SCEVSignExtendExpr(const SCEVHandle &op, const Type *ty)
assert((Op->getType()->isInteger() || isa<PointerType>(Op->getType())) &&
(Ty->isInteger() || isa<PointerType>(Ty)) &&
"Cannot sign extend non-integer value!");
- assert(Op->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits()
- && "This is not an extending conversion!");
}
SCEVSignExtendExpr::~SCEVSignExtendExpr() {
@@ -654,6 +648,10 @@ SCEVHandle SCEVAddRecExpr::evaluateAtIteration(SCEVHandle It,
//===----------------------------------------------------------------------===//
SCEVHandle ScalarEvolution::getTruncateExpr(const SCEVHandle &Op, const Type *Ty) {
+ assert(getTargetData().getTypeSizeInBits(Op->getType()) >
+ getTargetData().getTypeSizeInBits(Ty) &&
+ "This is not a truncating conversion!");
+
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
return getUnknown(
ConstantExpr::getTrunc(SC->getValue(), Ty));
@@ -702,6 +700,10 @@ SCEVHandle ScalarEvolution::getZeroExtendExpr(const SCEVHandle &Op,
}
SCEVHandle ScalarEvolution::getSignExtendExpr(const SCEVHandle &Op, const Type *Ty) {
+ assert(getTargetData().getTypeSizeInBits(Op->getType()) <
+ getTargetData().getTypeSizeInBits(Ty) &&
+ "This is not an extending conversion!");
+
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
const Type *IntTy = Ty;
if (isa<PointerType>(IntTy)) IntTy = getTargetData().getIntPtrType();
OpenPOWER on IntegriCloud