[ObjC][ARC] Ignore operand bundle "clang.arc.attachedcall" on a call if
authorAkira Hatanaka <ahatanaka@apple.com>
Mon, 28 Jun 2021 18:02:30 +0000 (11:02 -0700)
committerAkira Hatanaka <ahatanaka@apple.com>
Mon, 28 Jun 2021 18:02:30 +0000 (11:02 -0700)
commitf85b9d644398767f6b5cb046f952ed7dbd7dfc7a
treebcce6eb91eeeb0338c13d12ebc788ea056bc2b4d
parent2a60ab76a796637d49bf1c7191f5b5a0c92f81bc
[ObjC][ARC] Ignore operand bundle "clang.arc.attachedcall" on a call if
the call's return type is void

Instead of trying hard to prevent global optimization passes such as
deadargelim from changing the return type to void, just ignore the
bundle if the return type is void. clang currently emits calls to
@llvm.objc.clang.arc.noop.use, which consumes the function call result,
immediately after the function call to prevent changes to the return
type, but optimization passes can delete the call to
@llvm.objc.clang.arc.noop.use if the function call doesn't return, which
enables deadargelim to change the return type.

rdar://76671438

Differential Revision: https://reviews.llvm.org/D103062
llvm/docs/LangRef.rst
llvm/include/llvm/Analysis/ObjCARCUtil.h
llvm/lib/IR/Verifier.cpp
llvm/test/Transforms/ObjCARC/contract-rv-attr.ll
llvm/test/Verifier/operand-bundles.ll