Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/lib/Analysis/Loads.cpp
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | static bool isDereferenceableAndAlignedPointer( | ||||
if (const GCRelocateInst *RelocateInst = dyn_cast<GCRelocateInst>(V)) | if (const GCRelocateInst *RelocateInst = dyn_cast<GCRelocateInst>(V)) | ||||
return isDereferenceableAndAlignedPointer( | return isDereferenceableAndAlignedPointer( | ||||
RelocateInst->getDerivedPtr(), Align, Size, DL, CtxI, DT, Visited); | RelocateInst->getDerivedPtr(), Align, Size, DL, CtxI, DT, Visited); | ||||
if (const AddrSpaceCastInst *ASC = dyn_cast<AddrSpaceCastInst>(V)) | if (const AddrSpaceCastInst *ASC = dyn_cast<AddrSpaceCastInst>(V)) | ||||
return isDereferenceableAndAlignedPointer(ASC->getOperand(0), Align, Size, | return isDereferenceableAndAlignedPointer(ASC->getOperand(0), Align, Size, | ||||
DL, CtxI, DT, Visited); | DL, CtxI, DT, Visited); | ||||
if (auto CS = ImmutableCallSite(V)) | |||||
if (const Value *RV = CS.getReturnedArgOperand()) | |||||
return isDereferenceableAndAlignedPointer(RV, Align, Size, DL, CtxI, DT, | |||||
Visited); | |||||
// If we don't know, assume the worst. | // If we don't know, assume the worst. | ||||
return false; | return false; | ||||
} | } | ||||
bool llvm::isDereferenceableAndAlignedPointer(const Value *V, unsigned Align, | bool llvm::isDereferenceableAndAlignedPointer(const Value *V, unsigned Align, | ||||
const DataLayout &DL, | const DataLayout &DL, | ||||
const Instruction *CtxI, | const Instruction *CtxI, | ||||
const DominatorTree *DT) { | const DominatorTree *DT) { | ||||
▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines |