1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/Transforms/ObjCARC
Akira Hatanaka a30499dbf2 [ObjC][ARC] Don't remove autoreleaseRV/retainRV pairs if the call isn't
a tail call

This reapplies the patch in https://reviews.llvm.org/rG1f5b471b8bf4,
which was reverted because it was causing crashes.

https://bugs.chromium.org/p/chromium/issues/detail?id=1061289#c2

Check that HasSafePathToCall is true before checking the call is a tail
call.

Original commit message:

Previosly ARC optimizer removed the autoreleaseRV/retainRV pair in the
following code, which caused the object returned by @something to be
placed in the autorelease pool because the call to @something isn't a
tail call:

```
  %call = call i8* @something(...)
  %2 = call i8* @objc_retainAutoreleasedReturnValue(i8* %call)
  %3 = call i8* @objc_autoreleaseReturnValue(i8* %2)
  ret i8* %3
```

Fix the bug by checking whether @something is a tail call.

rdar://problem/59275894
2020-03-13 13:52:14 -07:00
..
allocas.ll
apelim.ll
basic.ll
cfg-hazards.ll
clang-arc-use-barrier.ll
code-motion.ll
comdat-ipo.ll
contract-catchswitch.ll
contract-end-of-use-list.ll
contract-marker-funclet.ll
contract-marker.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
escape.ll
expand.ll
funclet.ll
gvn.ll
inert-global.ll
inlined-autorelease-return-value.ll
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
opt-catchswitch.ll
opt-max-ptr-states.ll
path-overflow.ll
pointer-types.ll
post-inlining.ll
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
weak-contract.ll
weak-copies.ll
weak-dce.ll
weak.ll