aboutsummaryrefslogtreecommitdiff
path: root/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
commitc5b206b6be61d0d933b98b6af5e22f42edd48ad1 (patch)
tree9e6a1e6d3b90890de3d1464a44a7cef8d30fe1ae /lib/Transforms/Scalar/LoopStrengthReduce.cpp
parent05e52a1b35e7feb359a176af462591697c4d9647 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 1908693cc2..3e92a16882 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/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(),