[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 25 13:50:25 PST 2021


rjmccall added a comment.

In D92808#2521042 <https://reviews.llvm.org/D92808#2521042>, @rsmith wrote:

> This change violates layering by including an Analysis header from IR; I'll be landing a revert as soon as I've finished testing it.

Should the header just be in IR?  We'd like to avoid duplicating constant strings unnecessarily between IRGen and IR passes.



================
Comment at: llvm/lib/IR/Instruction.cpp:580
+    if (auto *CB = dyn_cast<CallBase>(this))
+      return objcarc::hasRetainRVOrClaimRVAttr(CB);
+    return false;
----------------
nikic wrote:
> This change looks pretty fishy. Objective C shouldn't be hijacking LLVMs core instruction model in this way. If it writes to memory, this should either be reflected in the attributes, or modeled using operand bundles.
> 
> @fhahn Did you review these changes? If not, I'd suggest to revert this patch and get a review on the LLVM changes.
This could definitely be an operand bundle, and I suppose the presence of a bundle does force a conservative assumption on passes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92808



More information about the cfe-commits mailing list