[PATCH] D55802: Change CGObjC to use objc intrinsics instead of runtime methods

Pete Cooper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 17 18:12:27 PST 2018


pete created this revision.
pete added reviewers: ahatanak, erik.pilkington.
Herald added subscribers: cfe-commits, javed.absar.

This is the final commit to make clang emit the intrinsics so that the ARC optimizer will always see intrinsics instead of runtime method calls.

The changes are mostly mechanical, just using getIntrinsic instead of creating a new method.

The tricky cases are:

- Old runtimes get weak_external declarations, so i've set the linkage on the intrinsics
- retain/release should be nonlazybind, which will now be handed in llvm itself when converted from intrinsic to runtime method for ISel
- objc_autoreleasePoolPop can throw so needs to invoke the runtime method, or call the intrinsic, as needed


Repository:
  rC Clang

https://reviews.llvm.org/D55802

Files:
  lib/CodeGen/CGObjC.cpp
  lib/CodeGen/CodeGenModule.h
  test/CodeGenObjC/arc-arm.m
  test/CodeGenObjC/arc-block-copy-escape.m
  test/CodeGenObjC/arc-blocks.m
  test/CodeGenObjC/arc-bridged-cast.m
  test/CodeGenObjC/arc-exceptions.m
  test/CodeGenObjC/arc-foreach.m
  test/CodeGenObjC/arc-i386.m
  test/CodeGenObjC/arc-linetable-autorelease.m
  test/CodeGenObjC/arc-linetable.m
  test/CodeGenObjC/arc-literals.m
  test/CodeGenObjC/arc-loadweakretained-release.m
  test/CodeGenObjC/arc-no-runtime.m
  test/CodeGenObjC/arc-precise-lifetime.m
  test/CodeGenObjC/arc-property.m
  test/CodeGenObjC/arc-related-result-type.m
  test/CodeGenObjC/arc-ternary-op.m
  test/CodeGenObjC/arc-unbridged-cast.m
  test/CodeGenObjC/arc-unopt.m
  test/CodeGenObjC/arc-unoptimized-byref-var.m
  test/CodeGenObjC/arc-unsafeclaim.m
  test/CodeGenObjC/arc-weak-property.m
  test/CodeGenObjC/arc-weak.m
  test/CodeGenObjC/arc-with-atthrow.m
  test/CodeGenObjC/arc.ll
  test/CodeGenObjC/arc.m
  test/CodeGenObjC/autorelease.m
  test/CodeGenObjC/debug-info-block-line.m
  test/CodeGenObjC/empty-collection-literals.m
  test/CodeGenObjC/fragile-arc.m
  test/CodeGenObjC/mrc-weak.m
  test/CodeGenObjC/noescape.m
  test/CodeGenObjC/ns_consume_null_check.m
  test/CodeGenObjC/nsvalue-objc-boxable-ios-arc.m
  test/CodeGenObjC/nsvalue-objc-boxable-mac-arc.m
  test/CodeGenObjC/objc-arc-container-subscripting.m
  test/CodeGenObjC/os_log.m
  test/CodeGenObjC/parameterized_classes.m
  test/CodeGenObjC/stret-lifetime.m
  test/CodeGenObjC/strong-in-c-struct.m
  test/CodeGenObjC/weak-in-c-struct.m
  test/CodeGenObjCXX/arc-attrs.mm
  test/CodeGenObjCXX/arc-blocks.mm
  test/CodeGenObjCXX/arc-constexpr.mm
  test/CodeGenObjCXX/arc-cxx11-init-list.mm
  test/CodeGenObjCXX/arc-exceptions.mm
  test/CodeGenObjCXX/arc-forwarded-lambda-call.mm
  test/CodeGenObjCXX/arc-globals.mm
  test/CodeGenObjCXX/arc-indirect.mm
  test/CodeGenObjCXX/arc-move.mm
  test/CodeGenObjCXX/arc-new-delete.mm
  test/CodeGenObjCXX/arc-pseudo-destructors.mm
  test/CodeGenObjCXX/arc-references.mm
  test/CodeGenObjCXX/arc-returns-inner-reference-ptr.mm
  test/CodeGenObjCXX/arc-special-member-functions.mm
  test/CodeGenObjCXX/arc-weak.mm
  test/CodeGenObjCXX/arc.mm
  test/CodeGenObjCXX/block-nested-in-lambda.mm
  test/CodeGenObjCXX/destroy.mm
  test/CodeGenObjCXX/lambda-expressions.mm
  test/CodeGenObjCXX/literals.mm
  test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
  test/CodeGenObjCXX/mrc-weak.mm
  test/CodeGenObjCXX/objc-weak.mm
  test/SemaObjC/arc-objc-lifetime-conflict.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55802.178577.patch
Type: text/x-patch
Size: 256141 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181218/7d904414/attachment-0001.bin>


More information about the cfe-commits mailing list