llvm-project/llvm/test/Transforms/ObjCARC
Duncan P. N. Exon Smith 3279724905 llvm/ObjCARC: Eliminate inlined AutoreleaseRV calls
Pair up inlined AutoreleaseRV calls with their matching RetainRV or
ClaimRV.

- RetainRV cancels out AutoreleaseRV.  Delete both instructions.
- ClaimRV is a peephole for RetainRV+Release.  Delete AutoreleaseRV and
  replace ClaimRV with Release.

This avoids problems where more aggressive inlining triggers memory
regressions.

This patch is happy to skip over non-callable instructions and non-ARC
intrinsics looking for the pair.  It is likely sound to also skip over
opaque function calls, but that's harder to reason about, and it's not
relevant to the goal here: if there's an opaque function call splitting
up a pair, it's very unlikely that a handshake would have happened
dynamically without inlining.

Note that this patch also subsumes the previous logic that looked
backwards from ReleaseRV.

https://reviews.llvm.org/D70370
rdar://problem/46509586
2019-11-19 12:02:01 -08:00
..
allocas.ll
apelim.ll
basic.ll [FunctionAttrs] Annotate "willreturn" for intrinsics 2019-07-28 06:09:56 +00:00
cfg-hazards.ll
clang-arc-use-barrier.ll
code-motion.ll [ObjC][ARC] Skip debug instructions when computing the insert point of 2019-09-19 20:58:51 +00:00
comdat-ipo.ll
contract-catchswitch.ll
contract-end-of-use-list.ll
contract-marker-funclet.ll
contract-marker.ll
contract-max-bb-size.ll
contract-replace-arg-use.ll
contract-storestrong-funclet.ll
contract-storestrong-ivar.ll
contract-storestrong.ll
contract-testcases.ll
contract.ll
empty-block.ll
ensure-that-exception-unwind-path-is-visited.ll [FunctionAttrs] Annotate "willreturn" for intrinsics 2019-07-28 06:09:56 +00:00
escape.ll
expand.ll
funclet.ll
gvn.ll
inert-global.ll
inlined-autorelease-return-value.ll llvm/ObjCARC: Eliminate inlined AutoreleaseRV calls 2019-11-19 12:02:01 -08:00
intrinsic-use-isolated.ll
intrinsic-use.ll
invoke-2.ll
invoke.ll
move-and-form-retain-autorelease.ll
move-and-merge-autorelease.ll
nested.ll [FunctionAttrs] Annotate "willreturn" for intrinsics 2019-07-28 06:09:56 +00:00
opt-catchswitch.ll
opt-max-ptr-states.ll
path-overflow.ll
pointer-types.ll
post-inlining.ll [ObjC][ARC] Ignore lifetime markers between *ReturnValue calls 2019-11-05 06:39:22 -08:00
pr12270.ll
provenance.ll
retain-block-side-effects.ll
retain-not-declared.ll
rle-s2l.ll
rv.ll
split-backedge.ll
tail-call-invariant-enforcement.ll
unsafe-claim-rv.ll llvm/ObjCARC: Eliminate inlined AutoreleaseRV calls 2019-11-19 12:02:01 -08:00
weak-contract.ll
weak-copies.ll
weak-dce.ll
weak.ll