From: Chris Lattner Date: Sun, 14 Jan 2007 05:57:53 +0000 (+0000) Subject: fit to 80 cols. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=241607d01648e85754f72de945684c7a8641a292;p=oota-llvm.git fit to 80 cols. Remove now-extraneous checks for ptr->ptr bitcasts. Fix PR1109 and Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll. We need to consider arbitrary sized objects when checking for nested GEP offsets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33195 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 3f6b722163a..a0c8a798af8 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -104,7 +104,7 @@ namespace { bool pointsToConstantMemory(const Value *P); virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS, - std::vector *Info); + std::vector *Info); private: // CheckGEPInstructions - Check two GEP instructions with known @@ -274,11 +274,9 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size, // Strip off cast instructions... if (const BitCastInst *I = dyn_cast(V1)) - if (isa(I->getOperand(0)->getType())) - return alias(I->getOperand(0), V1Size, V2, V2Size); + return alias(I->getOperand(0), V1Size, V2, V2Size); if (const BitCastInst *I = dyn_cast(V2)) - if (isa(I->getOperand(0)->getType())) - return alias(V1, V1Size, I->getOperand(0), V2Size); + return alias(V1, V1Size, I->getOperand(0), V2Size); // Figure out what objects these things are pointing to if we can... const Value *O1 = getUnderlyingObject(V1); @@ -363,7 +361,7 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size, Constant::getNullValue(cast(BasePtr2)->getOperand(1)->getType())); // Do the base pointers alias? - AliasResult BaseAlias = alias(BasePtr1, V1Size, BasePtr2, V2Size); + AliasResult BaseAlias = alias(BasePtr1, ~0U, BasePtr2, ~0U); if (BaseAlias == NoAlias) return NoAlias; if (BaseAlias == MustAlias) { // If the base pointers alias each other exactly, check to see if we can @@ -694,9 +692,9 @@ BasicAliasAnalysis::CheckGEPInstructions( // value possible. // if (const ArrayType *AT = dyn_cast(BasePtr1Ty)) - GEP1Ops[i] = ConstantInt::get(Type::Int64Ty, AT->getNumElements()-1); + GEP1Ops[i] = ConstantInt::get(Type::Int64Ty,AT->getNumElements()-1); else if (const PackedType *PT = dyn_cast(BasePtr1Ty)) - GEP1Ops[i] = ConstantInt::get(Type::Int64Ty, PT->getNumElements()-1); + GEP1Ops[i] = ConstantInt::get(Type::Int64Ty,PT->getNumElements()-1); } }