llvm-6502/lib
Michael Gottesman 0d92a3c600 [ObjCARC] Strength reduce objc_retainBlock -> objc_retain if the objc_retainBlock is optimizable.
If an objc_retainBlock has the copy_on_escape metadata attached to it
AND if the block pointer argument only escapes down the stack, we are
allowed to strength reduce the objc_retainBlock to to an objc_retain and
thus optimize it.

Current there is logic in the ARC data flow analysis to handle
this case which is complicated and involved making distinctions in
between objc_retainBlock and objc_retain in certain places and
considering them the same in others.

This patch simplifies said code by:

1. Performing the strength reduction in the initial ARC peephole
analysis (ObjCARCOpts::OptimizeIndividualCalls).

2. Changes the ARC dataflow analysis (which runs after the peephole
analysis) to consider all objc_retainBlock calls to not be optimizable
(since if the call was optimizable, we would have strength reduced it
already).

This patch leaves in the infrastructure in the ARC dataflow analysis to
handle this case, which due to 2 will just be dead code. I am doing this
on purpose to separate the removal of the old code from the testing of
the new code.

<rdar://problem/13249661>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178284 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 20:11:19 +00:00
..
Analysis BasicAA: Only query twice if the result of the more general query was MayAlias 2013-03-26 18:07:53 +00:00
Archive Fix auto_ptr is deprecated warnings 2013-02-26 21:20:35 +00:00
AsmParser Unify clang/llvm attributes for asan/tsan/msan (LLVM part) 2013-02-26 06:58:09 +00:00
Bitcode
CodeGen Fix target-customized spilling in the register scavenger 2013-03-27 13:00:56 +00:00
DebugInfo Fix missing std::. Not sure how this compiles for anyone else. 2013-03-21 00:57:21 +00:00
ExecutionEngine
IR Revert "Adding DIImportedModules to DIScopes." 2013-03-28 02:44:59 +00:00
IRReader Split out the IRReader header and the utility functions it provides into 2013-03-26 02:25:37 +00:00
Linker Specutively revert r178130. 2013-03-27 17:54:41 +00:00
MC Dead code. 2013-03-19 22:13:05 +00:00
Object Move an assert earlier in a file and check that the result of 2013-02-28 20:26:17 +00:00
Option
Support Don't try to generate crash diagnostics if we had an I/O failure. It's very 2013-03-27 18:30:00 +00:00
TableGen Allow TableGen DAG arguments to be just a name. 2013-03-24 19:36:51 +00:00
Target Hexagon: Replace switch-case in isDotNewInst with TSFlags. 2013-03-28 19:44:04 +00:00
Transforms [ObjCARC] Strength reduce objc_retainBlock -> objc_retain if the objc_retainBlock is optimizable. 2013-03-28 20:11:19 +00:00
CMakeLists.txt Split out the IRReader header and the utility functions it provides into 2013-03-26 02:25:37 +00:00
LLVMBuild.txt Split out the IRReader header and the utility functions it provides into 2013-03-26 02:25:37 +00:00
Makefile Split out the IRReader header and the utility functions it provides into 2013-03-26 02:25:37 +00:00