This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add hlfir.elemental and hlfir.yield_element definition
ClosedPublic

Authored by jeanPerier on Dec 14 2022, 5:31 AM.

Details

Summary

hlfir.elemental is the operation that will allow representing all
Fortran elemental expressions and more as functions of the indices.
See https://github.com/llvm/llvm-project/blob/main/flang/docs/HighLevelFIR.md for
more details about it.

Also add hlfir.yield_elemement which is the hlfir.elemental region terminator.

Diff Detail

Event Timeline

jeanPerier created this revision.Dec 14 2022, 5:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 5:31 AM
jeanPerier requested review of this revision.Dec 14 2022, 5:31 AM
clementval added inline comments.Dec 14 2022, 5:55 AM
flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
450

pre-commit check is complaining here:

error: no member named 'getRank' in 'hlfir::ExprType'

Add missing ExprType::getRank() definition.

flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
450

Whoops. Bad split of my changes. Should be fixed now.

This revision is now accepted and ready to land.Dec 14 2022, 6:32 AM