This is an archive of the discontinued LLVM Phabricator instance.

[LTO] Add configuartion option to use default optimization pipeline
ClosedPublic

Authored by jhuber6 on Mar 21 2022, 6:27 AM.

Details

Summary

This patch adds a configuration option to simply use the default pass
pipeline in favor of the LTO-specific one. We observed some severe
performance penalties when uding device-side LTO for OpenMP offloading
applications caused by the LTO-pass pipeline. This is primarily because
OpenMP uses an LLVM bitcode library to implement a GPU runtime library.
In a standard compilation we link this bitcode library into each source
file and optimize it with the default pipeline. When performing LTO we
link it late with all the files, but the bitcode library never has the
regular optimization pipeline applied to it so we miss a few
optimizations just using the LTO pipeline to optimize it.

I'm not committed to this solution, but it's the easiest method to solve
this performance regression when using LTO without changing the
optimizatin pipeline for other users.

Diff Detail

Event Timeline

jhuber6 created this revision.Mar 21 2022, 6:27 AM
jhuber6 requested review of this revision.Mar 21 2022, 6:27 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 21 2022, 6:27 AM
tianshilei1992 accepted this revision.Mar 21 2022, 6:59 PM

I tested it locally, and it fixes the performance regression. Since it is internal flag, it will not break any existing code. I'm okay with the change. Not sure if we want to ask the gate keeper of LTOBackend.

This revision is now accepted and ready to land.Mar 21 2022, 6:59 PM
jhuber6 added a reviewer: pcc.Mar 21 2022, 7:55 PM
This revision was landed with ongoing or failed builds.Mar 22 2022, 6:28 AM
This revision was automatically updated to reflect the committed changes.