Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Common up the -debug-pass-manager option between LTOCodeGenerator, llvm-lto (which uses LTOCodeGenerator), and llvm-lto2 (which does not use LTOCodeGenerator but uses libLLVMLTO).
Add testcase.
llvm/lib/LTO/LTOCodeGenerator.cpp | ||
---|---|---|
135 | Needed in ThinLTOCodeGenerator.cpp too? Looks like it is passed down from llvm-lto to there but I assume you wanted to set this via the linker? Not a legacy LTO user though, @steven_wu may have more thoughts. | |
llvm/tools/llvm-lto2/llvm-lto2.cpp | ||
172 | It seems a little odd to have the new LTO tool rely on an option in the legacy LTO. Maybe the def should be moved to LTO.cpp which is the new LTO and which the legacy LTO is gradually starting to use? |
I assume this is a debug option for LTO developer that is not going for production. That is why I said LGTM without a test case. I do think it will be good to set that in ThinLTOCodeGenerator as well, probably not needed for llvm-lto2.
The same option was already in llvm-lto2, but the more recent version of the patch removed the option from there and changed it to use the copy in LTOCodeGenerator.cpp, which I don't think is a good idea.
llvm/lib/LTO/LTOCodeGenerator.cpp | ||
---|---|---|
135 | Yep, I intend to pass this option via the linker. Sorry for keep forgetting about thinLTO; we don't use it yet. If we are to add processing of the DebugPassManager cl::opt to ThinLTOCodeGenerator then we'll have to remove it from llvm-lto, and remove the DebugPassManager parameter from a bunch of static functions in ThinLTOCodeGenerator.cpp. @fhahn FYI, since you added that code. | |
llvm/tools/llvm-lto2/llvm-lto2.cpp | ||
172 | Moving the option's def to LTO.cpp makes sense. |
llvm/lib/LTO/LTOCodeGenerator.cpp | ||
---|---|---|
135 | Thanks that should be fine. |
I bisected a breakage in our auto-roller to this change. I seems that in DLLVM_LINK_LLVM_DYLIB mode this break the opt command:
$ opt -internalize -internalize-public-api-list=main -globaldce test.o -o test2.o : CommandLine Error: Option 'debug-pass-manager' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options
Our auto-roller that is failing is at https://autoroll.skia.org/r/llvm-project-emscripten-releases.
This is currently blocking llvm changes from getting into new emscripten releases. Perhaps we can revert?
Needed in ThinLTOCodeGenerator.cpp too? Looks like it is passed down from llvm-lto to there but I assume you wanted to set this via the linker? Not a legacy LTO user though, @steven_wu may have more thoughts.