[PATCH] D34585: Make visible isDereferenceableAndAlignedPointer(..., const APInt &Size, ...)
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 23 18:36:00 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL306193: Make visible isDereferenceableAndAlignedPointer(..., const APInt &Size, ...) (authored by vitalybuka).
Changed prior to commit:
https://reviews.llvm.org/D34585?vs=103810&id=103819#toc
Repository:
rL LLVM
https://reviews.llvm.org/D34585
Files:
llvm/trunk/include/llvm/Analysis/Loads.h
llvm/trunk/lib/Analysis/Loads.cpp
Index: llvm/trunk/lib/Analysis/Loads.cpp
===================================================================
--- llvm/trunk/lib/Analysis/Loads.cpp
+++ llvm/trunk/lib/Analysis/Loads.cpp
@@ -117,6 +117,16 @@
}
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,
const DominatorTree *DT) {
Index: llvm/trunk/include/llvm/Analysis/Loads.h
===================================================================
--- llvm/trunk/include/llvm/Analysis/Loads.h
+++ llvm/trunk/include/llvm/Analysis/Loads.h
@@ -39,6 +39,15 @@
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34585.103819.patch
Type: text/x-patch
Size: 2181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170624/e034d104/attachment.bin>
More information about the llvm-commits
mailing list