From c635f47d9a02dc7da288864169804d3ff9481e8b Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sun, 31 Dec 2006 05:48:39 +0000 Subject: 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 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp') 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(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::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::iterator II = SI->second.IVs.begin(), -- cgit v1.2.3