[PATCH] D70370: llvm/ObjCARC: Eliminate inlined AutoreleaseRV calls

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 17 22:11:55 PST 2019


dexonsmith marked 3 inline comments as done.
dexonsmith added inline comments.


================
Comment at: llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp:742
+  // Convert the AutoreleaseRV into a ReleaseRV and run the normal
+  // optimizations.
+  CallInst *Release =
----------------
rjmccall wrote:
> "into a normal Release"
> 
> Please add something like `assert(Class == ARCInstKind::ClaimRV);` to make it clearer in the code why this is reasonable behavior.
Fixed in the updated diff.


================
Comment at: llvm/test/Transforms/ObjCARC/inlined-autorelease-return-value.ll:114
+  ret i8* %c
+}
+
----------------
rjmccall wrote:
> Do you want to add a test for when there's any sort of interference besides just being in separate blocks?  Or for when there are bitcasts?
Yes, I'll add both of those.  For interference, is it enough to put a call to `llvm.objc.retain` in between, or is there something else worth testing?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70370/new/

https://reviews.llvm.org/D70370





More information about the llvm-commits mailing list