Page MenuHomePhabricator

[flang][driver] Use `-O{0|1|2|3}` to define LLVM backend pass pipeline

Authored by awarzynski on Jun 17 2022, 6:26 AM.



Support for optimisation flags in LLVM Flang was originally added in That patch focused on LLVM
middle-end/optimisation pipelines. With this patch, Flang will
additionally configure LLVM backend pass pipelines accordingly. This
behavior is consistent with Clang.

New hook is added to translate compiler optimisation flags (e.g. -O3)
into backend optimisation level: getCGOptLevel. Identical hooks are
available in Clang and LLVM. In other words, the meaning of these
optimisation flags remains consistent with other sub-projects that use
LLVM backends.

Depends on D128043

Diff Detail

Event Timeline

awarzynski created this revision.Jun 17 2022, 6:26 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
awarzynski requested review of this revision.Jun 17 2022, 6:26 AM
rovka accepted this revision.Jun 21 2022, 5:46 AM

Seems fine, thanks.

This revision is now accepted and ready to land.Jun 21 2022, 5:46 AM

Rebase + address Diana's comments

This revision was landed with ongoing or failed builds.Jun 27 2022, 8:09 AM
This revision was automatically updated to reflect the committed changes.