OSDN Git Service

[ObjC][ARC] Let ARC optimizer bail out if the number of pointer states
authorAkira Hatanaka <ahatanaka@apple.com>
Thu, 25 Apr 2019 19:42:55 +0000 (19:42 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Thu, 25 Apr 2019 19:42:55 +0000 (19:42 +0000)
commit85656d2bc35e5af4b67a4c5e7c1f726788231785
tree6a688f66dcefe2567385bcb600a2a976efb2228e
parent85430e7ae4fa52bbcf2ddb48b42f52034a8c036f
[ObjC][ARC] Let ARC optimizer bail out if the number of pointer states
it keeps track of becomes too large

ARC optimizer does a top-down and a bottom-up traversal of the whole
function to pair up retain and release instructions and remove them.
This can be expensive if the number of instructions in the function and
pointer states it tracks are large since it has to look at each pointer
state and determine whether the instruction being visited can
potentially use the pointer.

This patch adds a command line option that sets a limit to the number of
pointers it tracks.

rdar://problem/49477063

Differential Revision: https://reviews.llvm.org/D61100

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359226 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/ObjCARC/ObjCARCOpts.cpp
test/Transforms/ObjCARC/opt-max-ptr-states.ll [new file with mode: 0644]