summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
commite0fc4dfc2275a2c36583e5800854e64d5f5e3255 (patch)
tree6a3d057b6742055ed3a3592e58421a7b41b42f1e /llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
parent5d417e35bc36094f2e6519866fd25f4d0db6c551 (diff)
downloadbcm5719-llvm-e0fc4dfc2275a2c36583e5800854e64d5f5e3255.tar.gz
bcm5719-llvm-e0fc4dfc2275a2c36583e5800854e64d5f5e3255.zip
For PR950:
This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. llvm-svn: 31063
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 7f0248845d5..e498860b5e8 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -264,7 +264,7 @@ SCEVHandle LoopStrengthReduce::GetExpressionSCEV(Instruction *Exp, Loop *L) {
// operand.
if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
const StructLayout *SL = TD->getStructLayout(STy);
- unsigned Idx = cast<ConstantUInt>(GEP->getOperand(i))->getValue();
+ unsigned Idx = cast<ConstantInt>(GEP->getOperand(i))->getZExtValue();
uint64_t Offset = SL->MemberOffsets[Idx];
GEPVal = SCEVAddExpr::get(GEPVal,
SCEVUnknown::getIntegerSCEV(Offset, UIntPtrTy));
@@ -275,7 +275,7 @@ SCEVHandle LoopStrengthReduce::GetExpressionSCEV(Instruction *Exp, Loop *L) {
uint64_t TypeSize = TD->getTypeSize(GTI.getIndexedType());
if (TypeSize != 1)
Idx = SCEVMulExpr::get(Idx,
- SCEVConstant::get(ConstantUInt::get(UIntPtrTy,
+ SCEVConstant::get(ConstantInt::get(UIntPtrTy,
TypeSize)));
GEPVal = SCEVAddExpr::get(GEPVal, Idx);
}
@@ -861,7 +861,7 @@ RemoveCommonExpressionsFromUseBases(std::vector<BasedUser> &Uses) {
///
static bool isZero(SCEVHandle &V) {
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(V))
- return SC->getValue()->getRawValue() == 0;
+ return SC->getValue()->getZExtValue() == 0;
return false;
}
OpenPOWER on IntegriCloud