This is an archive of the discontinued LLVM Phabricator instance.

[flang] Introduce option to lower expression to HLFIR
ClosedPublic

Authored by jeanPerier on Oct 14 2022, 7:05 AM.

Details

Summary

Preliminary work on HLFIR. Introduce option that will allow testing
lowering via HLFIR until this is ready to replace the current expression
lowering.

See https://reviews.llvm.org/D134285 for more context about the plan.

Diff Detail

Event Timeline

jeanPerier created this revision.Oct 14 2022, 7:05 AM
Herald added a project: Restricted Project. · View Herald Transcript
jeanPerier requested review of this revision.Oct 14 2022, 7:05 AM
clementval accepted this revision.Oct 14 2022, 7:14 AM

LGTM. Good to see this work getting started!

flang/include/flang/Lower/AbstractConverter.h
131

Is this change related?

This revision is now accepted and ready to land.Oct 14 2022, 7:14 AM
jeanPerier added inline comments.Oct 14 2022, 8:13 AM
flang/include/flang/Lower/AbstractConverter.h
131

Yes, I renamed the argument name in the override definition in lib/Lower/Bridge.cpp, so it seemed more consistent to also changed it in the abstract declaration.

Good to see HLFIR getting going! Do you have a plan to support this in the flang-new driver as well as bbc?

It looks to me like references to the data member lowerToHighLevelFIR should be made consistent.

flang/include/flang/Lower/LoweringOptions.h
29

Shouldn't this be bool rather than unsigned?

It looks to me like references to the data member lowerToHighLevelFIR should be made consistent.

flang/include/flang/Lower/LoweringOptions.h
29

IIRC, MSVC does not like mixed bitfields.

Good to see HLFIR getting going! Do you have a plan to support this in the flang-new driver as well as bbc?

Yes, when there is some end-to-end support for this new path, I will add a way to control the option in flang-new too.

It looks to me like references to the data member lowerToHighLevelFIR should be made consistent.

The members LoweringOptions were previously added as bit-fields (https://en.cppreference.com/w/cpp/language/bit_field), so making the new one a bool would be inconsistent.

This revision was automatically updated to reflect the committed changes.