IR printing has not been correctly supported with (Thin)LTO if the new pass manager is enabled. Previously we only get outputs from backend(codegen) passes, as they are still under legacy pass manager even when the new pass manager is enabled. This patch addresses the issue and enables IR printing for optimization passes with new pass manager + (Thin)LTO setting.
Thanks for fixing this. Comment on the test case below.
|1 ↗||(On Diff #215227)|
This relies on invoking the backend via clang invoking the linker, which we don't generally do in the llvm tests and is probably not a good idea. Just use llvm-lto2. That should also make it easier to simplify down to a single input file - you should only need one file with one function to test this behavior.