X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FLoads.cpp;h=315a42ef37692e7bd5b2777113efd8eead356ac1;hb=c94da20917cb4dfa750903b366c920210c5265ee;hp=aaaf75f3015c8bed1be78f439a92d2b3f005ca57;hpb=2337c1fd835fd7b0b890529ec133c81bb71d3b3d;p=oota-llvm.git diff --git a/lib/Analysis/Loads.cpp b/lib/Analysis/Loads.cpp index aaaf75f3015..315a42ef376 100644 --- a/lib/Analysis/Loads.cpp +++ b/lib/Analysis/Loads.cpp @@ -179,11 +179,10 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB, // Try to get the DataLayout for this module. This may be null, in which case // the optimizations will be limited. - const DataLayout *DL = ScanBB->getModule()->getDataLayout(); + const DataLayout &DL = ScanBB->getModule()->getDataLayout(); // Try to get the store size for the type. - uint64_t AccessSize = DL ? DL->getTypeStoreSize(AccessTy) - : AA ? AA->getTypeStoreSize(AccessTy) : 0; + uint64_t AccessSize = DL.getTypeStoreSize(AccessTy); Value *StrippedPtr = Ptr->stripPointerCasts(); @@ -208,7 +207,7 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB, if (LoadInst *LI = dyn_cast(Inst)) if (AreEquivalentAddressValues( LI->getPointerOperand()->stripPointerCasts(), StrippedPtr) && - CastInst::isBitOrNoopPointerCastable(LI->getType(), AccessTy, DL)) { + CastInst::isBitOrNoopPointerCastable(LI->getType(), AccessTy, &DL)) { if (AATags) LI->getAAMetadata(*AATags); return LI; @@ -221,7 +220,7 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB, // those cases are unlikely.) if (AreEquivalentAddressValues(StorePtr, StrippedPtr) && CastInst::isBitOrNoopPointerCastable(SI->getValueOperand()->getType(), - AccessTy, DL)) { + AccessTy, &DL)) { if (AATags) SI->getAAMetadata(*AATags); return SI->getOperand(0);