From 5461d45abf940b51cfe97eaa0a7cf274d43cb394 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Thu, 23 Apr 2015 17:36:48 +0000 Subject: Move Value.isDereferenceablePointer to ValueTracking [NFC] Move isDereferenceablePointer function to Analysis. This function recursively tracks dereferencability over a chain of values like other functions in ValueTracking. This refactoring is motivated by further changes to support dereferenceable_or_null attribute (http://reviews.llvm.org/D8650). isDereferenceablePointer will be extended to perform context-sensitive analysis and IR is not a good place to have such functionality. Patch by: Artur Pilipenko Differential Revision: reviews.llvm.org/D9075 llvm-svn: 235611 --- llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index 56b6cd3..1505ff0 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1204,7 +1204,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { II->addAttribute(AttributeSet::ReturnIndex, Attribute::NonNull); // isDereferenceablePointer -> deref attribute - if (DerivedPtr->isDereferenceablePointer(DL)) { + if (isDereferenceablePointer(DerivedPtr, DL)) { if (Argument *A = dyn_cast(DerivedPtr)) { uint64_t Bytes = A->getDereferenceableBytes(); II->addDereferenceableAttr(AttributeSet::ReturnIndex, Bytes); -- cgit v1.1