Minor refactoring of GEP handling in isDereferenceablePointer
authorArtur Pilipenko <apilipenko@azulsystems.com>
Mon, 8 Jun 2015 11:58:13 +0000 (11:58 +0000)
committerArtur Pilipenko <apilipenko@azulsystems.com>
Mon, 8 Jun 2015 11:58:13 +0000 (11:58 +0000)
commit1328b67dd1faf6edbe06bcf7189cc86db9f619cb
tree436bdc806daab3336d5de0e84782bdc3bdd6120c
parenta420a142769d5d86ce55f9027668861d04238366
Minor refactoring of GEP handling in isDereferenceablePointer

For GEP instructions isDereferenceablePointer checks that all indices are constant and within bounds. Replace this index calculation logic to a call to accumulateConstantOffset. Separated from the http://reviews.llvm.org/D9791

Reviewed By: sanjoy

Differential Revision: http://reviews.llvm.org/D9874

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239299 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ValueTracking.cpp
test/Analysis/ValueTracking/memory-dereferenceable.ll