This fixes a bug which causes the ARC contract pass to not insert the assembly marker that is needed for the runtime to do the objc_autoreleaseReturnValue/ objc_retainAutoreleasedReturnValue optimization when compiling on ARM64/ARM with LTO enabled. This happens because IRLinker::linkNamedMDNodes() adds all the operands from the source modules to the metadata's operand list in the merged module (see the example below) and ARC contract fails to extract the marker string if the metadata has more than one operand.
clang.arc.retainAutoreleasedReturnValueMarker = !{!0, !0} !0 = !{!"mov\09fp, fp\09\09# marker for objc_retainAutoreleaseReturnValue"}
To fix the bug, this patch emits the marker as a module flag.
rdar://problem/49464214