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

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 11 11:43:36 PST 2021


ahatanak updated this revision to Diff 315886.
ahatanak added a comment.

Rebase and fix a few bugs in the patch.

- In the loop in `DeadArgumentEliminationPass::SurveyFunction` that visits the uses of a function, continue instead of break so that the function is marked live when a function is used by something that isn't a `CallBase`.

- Make `ObjCARCOpt::OptimizeIndividualCallImpl` return early if the instruction is a retainRV/claimRV that was temporarily inserted after a call annotated with a retainRV/claimRV attribute. This fixes the first assertion in `ObjCARCOpt::OptimizeRetainRVCall`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92808

Files:
  clang/lib/CodeGen/CGObjC.cpp
  clang/test/CodeGenObjC/arc-rv-attr.m
  clang/test/CodeGenObjC/arc-unsafeclaim.m
  llvm/include/llvm/Analysis/ObjCARCRVAttr.h
  llvm/lib/IR/Instruction.cpp
  llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
  llvm/lib/Transforms/ObjCARC/ARCRuntimeEntryPoints.h
  llvm/lib/Transforms/ObjCARC/ObjCARC.cpp
  llvm/lib/Transforms/ObjCARC/ObjCARC.h
  llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
  llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
  llvm/lib/Transforms/ObjCARC/PtrState.cpp
  llvm/lib/Transforms/ObjCARC/PtrState.h
  llvm/lib/Transforms/Utils/InlineFunction.cpp
  llvm/test/Transforms/DeadArgElim/deadretval.ll
  llvm/test/Transforms/Inline/inline-retainRV-call.ll
  llvm/test/Transforms/ObjCARC/contract-marker-funclet.ll
  llvm/test/Transforms/ObjCARC/contract-rv-attr.ll
  llvm/test/Transforms/ObjCARC/rv.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92808.315886.patch
Type: text/x-patch
Size: 55730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210111/7e8fc720/attachment-0001.bin>


More information about the cfe-commits mailing list