mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-28 22:00:30 +00:00
Make visible isDereferenceableAndAlignedPointer(..., const APInt &Size, ...)
Summary: Used by D34311 and D34467 Reviewers: hfinkel, efriedma Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34585 llvm-svn: 306193
This commit is contained in:
parent
a8e1f97e9f
commit
d79c3e8584
@ -39,6 +39,15 @@ bool isDereferenceableAndAlignedPointer(const Value *V, unsigned Align,
|
||||
const Instruction *CtxI = nullptr,
|
||||
const DominatorTree *DT = nullptr);
|
||||
|
||||
/// Returns true if V is always dereferenceable for Size byte with alignment
|
||||
/// greater or equal than requested. If the context instruction is specified
|
||||
/// performs context-sensitive analysis and returns true if the pointer is
|
||||
/// dereferenceable at the specified instruction.
|
||||
bool isDereferenceableAndAlignedPointer(const Value *V, unsigned Align,
|
||||
const APInt &Size, const DataLayout &DL,
|
||||
const Instruction *CtxI = nullptr,
|
||||
const DominatorTree *DT = nullptr);
|
||||
|
||||
/// Return true if we know that executing a load from this value cannot trap.
|
||||
///
|
||||
/// If DT and ScanFrom are specified this method performs context-sensitive
|
||||
|
@ -116,6 +116,16 @@ static bool isDereferenceableAndAlignedPointer(
|
||||
return false;
|
||||
}
|
||||
|
||||
bool llvm::isDereferenceableAndAlignedPointer(const Value *V, unsigned Align,
|
||||
const APInt &Size,
|
||||
const DataLayout &DL,
|
||||
const Instruction *CtxI,
|
||||
const DominatorTree *DT) {
|
||||
SmallPtrSet<const Value *, 32> Visited;
|
||||
return ::isDereferenceableAndAlignedPointer(V, Align, Size, DL, CtxI, DT,
|
||||
Visited);
|
||||
}
|
||||
|
||||
bool llvm::isDereferenceableAndAlignedPointer(const Value *V, unsigned Align,
|
||||
const DataLayout &DL,
|
||||
const Instruction *CtxI,
|
||||
|
Loading…
Reference in New Issue
Block a user