<div dir="ltr">Hello front end devs,<div><br></div><div>AMDGPUOpenMP.cpp in Driver/ToolChains currently spawns an instance of llvm-link to stitch multiple input files together and splice in ~libm at the same time.</div><div><br></div><div>I can solve an obscure amdgpu-specific problem if that fork to llvm-link can be replaced by calling into the corresponding llvm libs. Specifically I need the attribute propagation behaviour of mlink-builtin-bitcode. Similar motivation as D28538 for nvptx.</div><div><br></div><div>It seems like calling llvm-link from the driver (from constructLLVMLinkCommand) is an unusual thing to do. What I basically want to do is call CodeGenModule::addDefaultFunctionDefinitionAttributes on each function in each file that is being linked. The producer of that file is unlikely to put the proper attributes on it.</div><div><br></div><div>What's the clean / sensible way to achieve this? Passing libm to lld instead is attractive, but lld also won't append the default function attributes. Patching llvm-link to optionally do this munging on the fly seems dubious.</div><div><br></div><div>Thank you!</div><div><br></div><div>Jon</div></div>