|
@@ -421,24 +421,21 @@ SCEVCastExpr::SCEVCastExpr(const FoldingSetNodeIDRef ID,
|
|
SCEVTruncateExpr::SCEVTruncateExpr(const FoldingSetNodeIDRef ID,
|
|
SCEVTruncateExpr::SCEVTruncateExpr(const FoldingSetNodeIDRef ID,
|
|
const SCEV *op, Type *ty)
|
|
const SCEV *op, Type *ty)
|
|
: SCEVCastExpr(ID, scTruncate, op, ty) {
|
|
: SCEVCastExpr(ID, scTruncate, op, ty) {
|
|
- assert((Op->getType()->isIntegerTy() || Op->getType()->isPointerTy()) &&
|
|
|
|
- (Ty->isIntegerTy() || Ty->isPointerTy()) &&
|
|
|
|
|
|
+ assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
|
|
"Cannot truncate non-integer value!");
|
|
"Cannot truncate non-integer value!");
|
|
}
|
|
}
|
|
|
|
|
|
SCEVZeroExtendExpr::SCEVZeroExtendExpr(const FoldingSetNodeIDRef ID,
|
|
SCEVZeroExtendExpr::SCEVZeroExtendExpr(const FoldingSetNodeIDRef ID,
|
|
const SCEV *op, Type *ty)
|
|
const SCEV *op, Type *ty)
|
|
: SCEVCastExpr(ID, scZeroExtend, op, ty) {
|
|
: SCEVCastExpr(ID, scZeroExtend, op, ty) {
|
|
- assert((Op->getType()->isIntegerTy() || Op->getType()->isPointerTy()) &&
|
|
|
|
- (Ty->isIntegerTy() || Ty->isPointerTy()) &&
|
|
|
|
|
|
+ assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
|
|
"Cannot zero extend non-integer value!");
|
|
"Cannot zero extend non-integer value!");
|
|
}
|
|
}
|
|
|
|
|
|
SCEVSignExtendExpr::SCEVSignExtendExpr(const FoldingSetNodeIDRef ID,
|
|
SCEVSignExtendExpr::SCEVSignExtendExpr(const FoldingSetNodeIDRef ID,
|
|
const SCEV *op, Type *ty)
|
|
const SCEV *op, Type *ty)
|
|
: SCEVCastExpr(ID, scSignExtend, op, ty) {
|
|
: SCEVCastExpr(ID, scSignExtend, op, ty) {
|
|
- assert((Op->getType()->isIntegerTy() || Op->getType()->isPointerTy()) &&
|
|
|
|
- (Ty->isIntegerTy() || Ty->isPointerTy()) &&
|
|
|
|
|
|
+ assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
|
|
"Cannot sign extend non-integer value!");
|
|
"Cannot sign extend non-integer value!");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3699,7 +3696,7 @@ const SCEV *ScalarEvolution::getUnknown(Value *V) {
|
|
/// target-specific information.
|
|
/// target-specific information.
|
|
bool ScalarEvolution::isSCEVable(Type *Ty) const {
|
|
bool ScalarEvolution::isSCEVable(Type *Ty) const {
|
|
// Integers and pointers are always SCEVable.
|
|
// Integers and pointers are always SCEVable.
|
|
- return Ty->isIntegerTy() || Ty->isPointerTy();
|
|
|
|
|
|
+ return Ty->isIntOrPtrTy();
|
|
}
|
|
}
|
|
|
|
|
|
/// Return the size in bits of the specified type, for which isSCEVable must
|
|
/// Return the size in bits of the specified type, for which isSCEVable must
|
|
@@ -3944,8 +3941,7 @@ const SCEV *ScalarEvolution::getMinusSCEV(const SCEV *LHS, const SCEV *RHS,
|
|
const SCEV *
|
|
const SCEV *
|
|
ScalarEvolution::getTruncateOrZeroExtend(const SCEV *V, Type *Ty) {
|
|
ScalarEvolution::getTruncateOrZeroExtend(const SCEV *V, Type *Ty) {
|
|
Type *SrcTy = V->getType();
|
|
Type *SrcTy = V->getType();
|
|
- assert((SrcTy->isIntegerTy() || SrcTy->isPointerTy()) &&
|
|
|
|
- (Ty->isIntegerTy() || Ty->isPointerTy()) &&
|
|
|
|
|
|
+ assert(SrcTy->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
|
|
"Cannot truncate or zero extend with non-integer arguments!");
|
|
"Cannot truncate or zero extend with non-integer arguments!");
|
|
if (getTypeSizeInBits(SrcTy) == getTypeSizeInBits(Ty))
|
|
if (getTypeSizeInBits(SrcTy) == getTypeSizeInBits(Ty))
|
|
return V; // No conversion
|
|
return V; // No conversion
|
|
@@ -3958,8 +3954,7 @@ const SCEV *
|
|
ScalarEvolution::getTruncateOrSignExtend(const SCEV *V,
|
|
ScalarEvolution::getTruncateOrSignExtend(const SCEV *V,
|
|
Type *Ty) {
|
|
Type *Ty) {
|
|
Type *SrcTy = V->getType();
|
|
Type *SrcTy = V->getType();
|
|
- assert((SrcTy->isIntegerTy() || SrcTy->isPointerTy()) &&
|
|
|
|
- (Ty->isIntegerTy() || Ty->isPointerTy()) &&
|
|
|
|
|
|
+ assert(SrcTy->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
|
|
"Cannot truncate or zero extend with non-integer arguments!");
|
|
"Cannot truncate or zero extend with non-integer arguments!");
|
|
if (getTypeSizeInBits(SrcTy) == getTypeSizeInBits(Ty))
|
|
if (getTypeSizeInBits(SrcTy) == getTypeSizeInBits(Ty))
|
|
return V; // No conversion
|
|
return V; // No conversion
|
|
@@ -3971,8 +3966,7 @@ ScalarEvolution::getTruncateOrSignExtend(const SCEV *V,
|
|
const SCEV *
|
|
const SCEV *
|
|
ScalarEvolution::getNoopOrZeroExtend(const SCEV *V, Type *Ty) {
|
|
ScalarEvolution::getNoopOrZeroExtend(const SCEV *V, Type *Ty) {
|
|
Type *SrcTy = V->getType();
|
|
Type *SrcTy = V->getType();
|
|
- assert((SrcTy->isIntegerTy() || SrcTy->isPointerTy()) &&
|
|
|
|
- (Ty->isIntegerTy() || Ty->isPointerTy()) &&
|
|
|
|
|
|
+ assert(SrcTy->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
|
|
"Cannot noop or zero extend with non-integer arguments!");
|
|
"Cannot noop or zero extend with non-integer arguments!");
|
|
assert(getTypeSizeInBits(SrcTy) <= getTypeSizeInBits(Ty) &&
|
|
assert(getTypeSizeInBits(SrcTy) <= getTypeSizeInBits(Ty) &&
|
|
"getNoopOrZeroExtend cannot truncate!");
|
|
"getNoopOrZeroExtend cannot truncate!");
|
|
@@ -3984,8 +3978,7 @@ ScalarEvolution::getNoopOrZeroExtend(const SCEV *V, Type *Ty) {
|
|
const SCEV *
|
|
const SCEV *
|
|
ScalarEvolution::getNoopOrSignExtend(const SCEV *V, Type *Ty) {
|
|
ScalarEvolution::getNoopOrSignExtend(const SCEV *V, Type *Ty) {
|
|
Type *SrcTy = V->getType();
|
|
Type *SrcTy = V->getType();
|
|
- assert((SrcTy->isIntegerTy() || SrcTy->isPointerTy()) &&
|
|
|
|
- (Ty->isIntegerTy() || Ty->isPointerTy()) &&
|
|
|
|
|
|
+ assert(SrcTy->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
|
|
"Cannot noop or sign extend with non-integer arguments!");
|
|
"Cannot noop or sign extend with non-integer arguments!");
|
|
assert(getTypeSizeInBits(SrcTy) <= getTypeSizeInBits(Ty) &&
|
|
assert(getTypeSizeInBits(SrcTy) <= getTypeSizeInBits(Ty) &&
|
|
"getNoopOrSignExtend cannot truncate!");
|
|
"getNoopOrSignExtend cannot truncate!");
|
|
@@ -3997,8 +3990,7 @@ ScalarEvolution::getNoopOrSignExtend(const SCEV *V, Type *Ty) {
|
|
const SCEV *
|
|
const SCEV *
|
|
ScalarEvolution::getNoopOrAnyExtend(const SCEV *V, Type *Ty) {
|
|
ScalarEvolution::getNoopOrAnyExtend(const SCEV *V, Type *Ty) {
|
|
Type *SrcTy = V->getType();
|
|
Type *SrcTy = V->getType();
|
|
- assert((SrcTy->isIntegerTy() || SrcTy->isPointerTy()) &&
|
|
|
|
- (Ty->isIntegerTy() || Ty->isPointerTy()) &&
|
|
|
|
|
|
+ assert(SrcTy->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
|
|
"Cannot noop or any extend with non-integer arguments!");
|
|
"Cannot noop or any extend with non-integer arguments!");
|
|
assert(getTypeSizeInBits(SrcTy) <= getTypeSizeInBits(Ty) &&
|
|
assert(getTypeSizeInBits(SrcTy) <= getTypeSizeInBits(Ty) &&
|
|
"getNoopOrAnyExtend cannot truncate!");
|
|
"getNoopOrAnyExtend cannot truncate!");
|
|
@@ -4010,8 +4002,7 @@ ScalarEvolution::getNoopOrAnyExtend(const SCEV *V, Type *Ty) {
|
|
const SCEV *
|
|
const SCEV *
|
|
ScalarEvolution::getTruncateOrNoop(const SCEV *V, Type *Ty) {
|
|
ScalarEvolution::getTruncateOrNoop(const SCEV *V, Type *Ty) {
|
|
Type *SrcTy = V->getType();
|
|
Type *SrcTy = V->getType();
|
|
- assert((SrcTy->isIntegerTy() || SrcTy->isPointerTy()) &&
|
|
|
|
- (Ty->isIntegerTy() || Ty->isPointerTy()) &&
|
|
|
|
|
|
+ assert(SrcTy->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
|
|
"Cannot truncate or noop with non-integer arguments!");
|
|
"Cannot truncate or noop with non-integer arguments!");
|
|
assert(getTypeSizeInBits(SrcTy) >= getTypeSizeInBits(Ty) &&
|
|
assert(getTypeSizeInBits(SrcTy) >= getTypeSizeInBits(Ty) &&
|
|
"getTruncateOrNoop cannot extend!");
|
|
"getTruncateOrNoop cannot extend!");
|