This is an archive of the discontinued LLVM Phabricator instance.

[NewPM][PassInstrumentation] IR printing support for (Thin)LTO
ClosedPublic

Authored by twoh on Aug 14 2019, 1:28 PM.

Details

Summary

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.

Event Timeline

twoh created this revision.Aug 14 2019, 1:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2019, 1:28 PM

Thanks for fixing this. Comment on the test case below.

llvm/test/LTO/X86/printer.ll
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.

twoh updated this revision to Diff 215427.Aug 15 2019, 10:16 AM

Addressed @tejohnson's comment on the test case. Thanks!

twoh updated this revision to Diff 215429.Aug 15 2019, 10:17 AM

Remove redundant lines from the test.

This revision is now accepted and ready to land.Aug 15 2019, 10:23 AM
This revision was automatically updated to reflect the committed changes.