Don't add a tail keyword to calls to ObjC runtime functions if the calls
authorAkira Hatanaka <ahatanaka@apple.com>
Thu, 21 Mar 2019 20:16:09 +0000 (20:16 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Thu, 21 Mar 2019 20:16:09 +0000 (20:16 +0000)
commitb576c77a9ead5cd523e48b49fc5e536800718912
tree5e55c3ba38b9daec136d0960d8b18e220a226dd4
parent3205dbb3f1f96e77e106f964dcf1b5f69fba4ecc
Don't add a tail keyword to calls to ObjC runtime functions if the calls
are annotated with notail.

r356705 annotated calls to objc_retainAutoreleasedReturnValue with
notail on x86-64. This commit teaches ARC optimizer to check the notail
marker on the call before turning it into a tail call.

rdar://problem/38675807

llvm-svn: 356707
llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
llvm/test/Transforms/ObjCARC/tail-call-invariant-enforcement.ll