diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-10-20 07:07:24 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-10-20 07:07:24 +0000 |
commit | b83eb6447ba155342598f0fabe1f08f5baa9164a (patch) | |
tree | a5822f5fdac89033b7b16ba8e5aaf1ae10833b1c /lib/Analysis/BasicAliasAnalysis.cpp | |
parent | 6e7dd9db6bf677c9161a6ecc12f90651cf1231e0 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | lib/Analysis/BasicAliasAnalysis.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index fdc452b44f..8d4cbdb93d 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -468,11 +468,10 @@ static bool ValuesEqual(Value *V1, Value *V2) { /// CheckGEPInstructions - Check two GEP instructions with known must-aliasing /// base pointers. This checks to see if the index expressions preclude the /// pointers from aliasing... -AliasAnalysis::AliasResult BasicAliasAnalysis:: -CheckGEPInstructions(const Type* BasePtr1Ty, std::vector<Value*> &GEP1Ops, - unsigned G1S, - const Type *BasePtr2Ty, std::vector<Value*> &GEP2Ops, - unsigned G2S) { +AliasAnalysis::AliasResult +BasicAliasAnalysis::CheckGEPInstructions( + const Type* BasePtr1Ty, std::vector<Value*> &GEP1Ops, unsigned G1S, + const Type *BasePtr2Ty, std::vector<Value*> &GEP2Ops, unsigned G2S) { // We currently can't handle the case when the base pointers have different // primitive types. Since this is uncommon anyway, we are happy being // extremely conservative. @@ -670,7 +669,7 @@ CheckGEPInstructions(const Type* BasePtr1Ty, std::vector<Value*> &GEP1Ops, if (const ConstantInt *Op1C = dyn_cast<ConstantInt>(Op1)) { // If this is an array index, make sure the array element is in range. if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty)) - if (Op1C->getRawValue() >= AT->getNumElements()) + if (Op1C->getZExtValue() >= AT->getNumElements()) return MayAlias; // Be conservative with out-of-range accesses } else { @@ -685,7 +684,7 @@ CheckGEPInstructions(const Type* BasePtr1Ty, std::vector<Value*> &GEP1Ops, // value possible. // if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty)) - GEP1Ops[i] = ConstantSInt::get(Type::LongTy,AT->getNumElements()-1); + GEP1Ops[i] = ConstantInt::get(Type::LongTy, AT->getNumElements()-1); } } @@ -693,7 +692,7 @@ CheckGEPInstructions(const Type* BasePtr1Ty, std::vector<Value*> &GEP1Ops, if (const ConstantInt *Op2C = dyn_cast<ConstantInt>(Op2)) { // If this is an array index, make sure the array element is in range. if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty)) - if (Op2C->getRawValue() >= AT->getNumElements()) + if (Op2C->getZExtValue() >= AT->getNumElements()) return MayAlias; // Be conservative with out-of-range accesses } else { // Conservatively assume the minimum value for this index GEP2Ops[i] = Constant::getNullValue(Op2->getType()); |