Specifying passes for ThinLTO?

Hi,

I am trying to test ThinLTO mode with lld, but am seeing failures because (at optimisation levels above -O0), clang inserts calls to clang.arc.use, which are expected to be removed by the ObjCARCCompact pass. Unfortunately, this pass doesn’t seem to be being run by lld (and adding -mllvm -print-after-all indicates that only SimplifyCFG is being run, which is a bit surprising, though the output is a bit mangled and appears to be coming from interleaved threads, so it’s possible that this is misleading). The documentation tells me that I can specify a new pass manager pipeline, but doesn’t tell me what the argument to this flag looks like. How do I tell lld that it should be running the ObjCARC passes during ThinLTO?

David

lld doesn't run pass(es). lld delegates to `lib/LTO` the creation of a
pass manager which runs passes.
The format for the -new-pm-passes flag is equal to the one used in
`opt`. The caveat is that only works for the new pass manager.
Regardless, the ThinLTO pipeline should run much more than
SimplifyCFG. You can read the set of passes run in
`lib/Transform/IPO/PassManagerBuilder.cpp/populateThinLTOPassManager()`