[PATCH] D61808: [ObjC] Replace uses of the argument of a call to objc_autorelease with the result in MRR
John McCall via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 16 16:01:20 PDT 2019
rjmccall added a comment.
Oh, yes, that's correct, at least under base ObjC rules.
Now, we *are* talking here about making some other higher-level assumptions about `retain`/`release`/`autorelease` that already exceed base ObjC rules. Turning `autorelease` into `autoreleaseRV` isn't sound under base ObjC rules because nothing in base ObjC permits us to not do a message send that's clearly called for in the source; but nonetheless we do want to do some optimizations like that even in MRR, and we think that's tolerable in part because `retain` and `release` are already special in ObjC (because of `retain` properties and block captures). So maybe it's not unreasonable to consider this assumption about the return value of `retain` and `autorelease` to be part of the higher-level semantics we want to assume for these messages.
However, (1) we need to carefully document those higher-level assumptions and (2) we need to make sure they're all disabled by this same no-builtin-retain-release flag, which means propagating information to the optimizer somehow (by just emitting non-builtin messages as normal message sends if necessary).
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61808/new/
https://reviews.llvm.org/D61808
More information about the llvm-commits
mailing list