This is an archive of the discontinued LLVM Phabricator instance.

[flang] add hlfir::FortranEntity class
ClosedPublic

Authored by jeanPerier on Oct 21 2022, 1:18 AM.

Details

Summary

Add hlfir::FortranEntity class and a first helper to convert it to
fir::ExtendedValue.

The hlfir::FortranEntity will be the core class of the new expression
lowering. It is conceptually very similar to what fir::ExtendedValue
is today, except that it is wrapping single mlir::Value: it holds the
SSA value for a lowered Fortran variable or expression value.

Depends on D136328

Diff Detail

Event Timeline

jeanPerier created this revision.Oct 21 2022, 1:18 AM
jeanPerier requested review of this revision.Oct 21 2022, 1:18 AM
clementval accepted this revision.Oct 21 2022, 1:30 AM

LGTM. Couple of typos.

flang/include/flang/Optimizer/Builder/HLFIRTools.h
27
32

Same for other comments below

54
This revision is now accepted and ready to land.Oct 21 2022, 1:30 AM
jeanPerier marked 2 inline comments as done.

Use llvm::Optional and fix comment typos.

Thanks for the review Valentin.

flang/include/flang/Optimizer/Builder/HLFIRTools.h
54

I disagree on this one, the "m" in "mlir" here is pronounced individually, and the consonant "M", when pronounced as an individual letter, begins with a vowel sound. I believe the rule is to use "an" when the next sounds is a vowel sound.

In MLIR directory:
find ./ -type f -print0 | xargs -0 grep --text -i ' an mlir' | wc -l -> 183

find ./ -type f -print0 | xargs -0 grep --text -i ' a mlir' | wc -l -> 34

clementval added inline comments.Oct 21 2022, 3:25 AM
flang/include/flang/Optimizer/Builder/HLFIRTools.h
54

Fine with an

This revision was automatically updated to reflect the committed changes.