summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-31 05:48:39 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-31 05:48:39 +0000
commitc635f47d9a02dc7da288864169804d3ff9481e8b (patch)
tree4f2083b89373271d840e29c5e22e9020c3be4d90 /llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
parentbe5fd4a771686af882281a392e28b68ef95eeed3 (diff)
downloadbcm5719-llvm-c635f47d9a02dc7da288864169804d3ff9481e8b.tar.gz
bcm5719-llvm-c635f47d9a02dc7da288864169804d3ff9481e8b.zip
For PR950:
This patch replaces signed integer types with signless ones: 1. [US]Byte -> Int8 2. [U]Short -> Int16 3. [U]Int -> Int32 4. [U]Long -> Int64. 5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion and other methods related to signedness. In a few places this warranted identifying the signedness information from other sources. llvm-svn: 32785
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 1908693cc29..3e92a168823 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -86,8 +86,8 @@ namespace {
Value *IncV;
IVExpr()
- : Stride(SCEVUnknown::getIntegerSCEV(0, Type::UIntTy)),
- Base (SCEVUnknown::getIntegerSCEV(0, Type::UIntTy)) {}
+ : Stride(SCEVUnknown::getIntegerSCEV(0, Type::Int32Ty)),
+ Base (SCEVUnknown::getIntegerSCEV(0, Type::Int32Ty)) {}
IVExpr(const SCEVHandle &stride, const SCEVHandle &base, PHINode *phi,
Value *incv)
: Stride(stride), Base(base), PHI(phi), IncV(incv) {}
@@ -334,12 +334,6 @@ static bool getSCEVStartAndStride(const SCEVHandle &SH, Loop *L,
<< "] Variable stride: " << *AddRec << "\n";
Stride = AddRec->getOperand(1);
- // Check that all constant strides are the unsigned type, we don't want to
- // have two IV's one of signed stride 4 and one of unsigned stride 4 to not be
- // merged.
- assert((!isa<SCEVConstant>(Stride) || Stride->getType()->isUnsigned()) &&
- "Constants should be canonicalized to unsigned!");
-
return true;
}
@@ -899,7 +893,7 @@ unsigned LoopStrengthReduce::CheckForIVReuse(const SCEVHandle &Stride,
if (unsigned(abs(SInt)) < Scale || (SInt % Scale) != 0)
continue;
std::map<SCEVHandle, IVsOfOneStride>::iterator SI =
- IVsByStride.find(SCEVUnknown::getIntegerSCEV(SInt/Scale, Type::UIntTy));
+ IVsByStride.find(SCEVUnknown::getIntegerSCEV(SInt/Scale, Type::Int32Ty));
if (SI == IVsByStride.end())
continue;
for (std::vector<IVExpr>::iterator II = SI->second.IVs.begin(),
OpenPOWER on IntegriCloud