Change CaptureTracking to pass a Use* instead of a Value* when a value is
authorNick Lewycky <nicholas@mxc.ca>
Wed, 28 Dec 2011 23:24:21 +0000 (23:24 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 28 Dec 2011 23:24:21 +0000 (23:24 +0000)
commitb48a18903a5769f0ecb295db069252576b1388b0
tree6536862781402e176a196c81e6f25a3b69ac9cbf
parentda813f420907ad29802ce9e80238258a48385212
Change CaptureTracking to pass a Use* instead of a Value* when a value is
captured. This allows the tracker to look at the specific use, which may be
especially interesting for function calls.

Use this to fix 'nocapture' deduction in FunctionAttrs. The existing one does
not iterate until a fixpoint and does not guarantee that it produces the same
result regardless of iteration order. The new implementation builds up a graph
of how arguments are passed from function to function, and uses a bottom-up walk
on the argument-SCCs to assign nocapture. This gets us nocapture more often, and
does so rather efficiently and independent of iteration order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147327 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/CaptureTracking.h
lib/Analysis/CaptureTracking.cpp
lib/Analysis/MemoryDependenceAnalysis.cpp
lib/Transforms/IPO/FunctionAttrs.cpp
test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
test/Transforms/FunctionAttrs/nocapture.ll