[PATCH] D61100: [ObjC][ARC] Let ARC optimizer bail out if the number of pointer states it keeps track of becomes too large

Akira Hatanaka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 15:36:18 PDT 2019


ahatanak created this revision.
ahatanak added reviewers: pete, smeenai.
ahatanak added a project: LLVM.
Herald added subscribers: dexonsmith, jkorous.

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 (see the loop in `ObjCARCOpt::VisitInstructionBottomUp` that calls `HandlePotentialUse`).

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

rdar://problem/49477063


Repository:
  rL LLVM

https://reviews.llvm.org/D61100

Files:
  lib/Transforms/ObjCARC/ObjCARCOpts.cpp
  test/Transforms/ObjCARC/opt-max-ptr-states.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61100.196530.patch
Type: text/x-patch
Size: 4993 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190424/eb9b144d/attachment.bin>


More information about the llvm-commits mailing list