[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)
commit8edf8f317b59e9a69823c816e850a04b9b6ae015
treee111cef33d744ad5b5691e61d0b02f508fed915c
parent2c97ff07bfd94971f6480a686f06292059538632
[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

llvm-svn: 359226
llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
llvm/test/Transforms/ObjCARC/opt-max-ptr-states.ll [new file with mode: 0644]