This is an archive of the discontinued LLVM Phabricator instance.

[PassBuilder] Support O0 in default pipelines
ClosedPublic

Authored by nikic on Mar 16 2023, 2:02 AM.

Details

Summary

The default and pre-link pipeline builders currently require you to call a separate method for optimization level O0, even though they have perfectly well-defined O0 optimization pipelines.

Accept O0 optimization level and call buildO0DefaultPipeline() internally, so all consumers don't need to repeat this.

Diff Detail

Event Timeline

nikic created this revision.Mar 16 2023, 2:02 AM
nikic requested review of this revision.Mar 16 2023, 2:02 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 16 2023, 2:02 AM
aeubanks accepted this revision.Mar 16 2023, 9:27 AM

yeah, the forced -O0 separation doesn't really make sense

This revision is now accepted and ready to land.Mar 16 2023, 9:27 AM
asbirlea added inline comments.Mar 16 2023, 10:58 AM
llvm/lib/Passes/PassBuilderPipelines.cpp
1554–1555

I'm missing why you're not calling buildO0DefaultPipeline for O0 here too.

nikic added inline comments.Mar 16 2023, 11:02 AM
llvm/lib/Passes/PassBuilderPipelines.cpp
1554–1555

buildPerModuleDefaultPipeline() will call buildO0DefaultPipeline() in this case.

asbirlea accepted this revision.Mar 16 2023, 1:58 PM
asbirlea added inline comments.
llvm/lib/Passes/PassBuilderPipelines.cpp
1554–1555

Ah, right! Thanks!

This revision was landed with ongoing or failed builds.Mar 17 2023, 2:00 AM
This revision was automatically updated to reflect the committed changes.
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptMar 17 2023, 2:00 AM