Open briantkelley opened 2 years ago
This is implemented in clang using the operand bundle clang.arc.attachedcall
. Quick testing with inline assembly seemed to indicate the magic nop is persisted through release optimizations on arm64, but additional testing and x86_64 investigation is still required.
The Objective-C runtime has return value optimizations for callers that execute specific instruction sequences upon return of the callee. Without these optimizations, the runtime performs retain/autorelease operations on the object, which incur a performance penalty.