David Chisnall via llvm-dev
2018-Apr-12 09:20 UTC
[llvm-dev] 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
Davide Italiano via llvm-dev
2018-Apr-12 15:20 UTC
[llvm-dev] Specifying passes for ThinLTO?
On Thu, Apr 12, 2018 at 2:20 AM, David Chisnall via llvm-dev <llvm-dev at lists.llvm.org> wrote:> 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? >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()` -- Davide
Reasonably Related Threads
- ThinLTO status in trunk?
- Any objections to moving ObjCARC analysis passes to llvm/Analysis?
- ThinLTO: passing TargetOptions to LLVMgold.so
- Building llvm with clang and lld on arm and the llvm arm backend relocation on position independent code
- Building llvm with clang and lld on arm and the llvm arm backend relocation on position independent code