By default, hlfir.elemental and hlfir.elemental_addr must process
the elements in order. The unordered attribute may be set,
if it is safe to process the elements out of order.
This patch just adds parsing support for the new attribute.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Looks good
flang/include/flang/Optimizer/HLFIR/HLFIROps.td | ||
---|---|---|
1244 | I agree that I do not see in which case we would currently generate a body with side effects. The only case I can think of is if we were to inline some "ordered" hlfir.elemental inside an hlfir.elemental_addr: the hlfir.elemental_addr should inherit the "ordered". But this is a risky optimization as there may be other Fortran rules to consider when doing this. |
flang/include/flang/Optimizer/HLFIR/HLFIROps.td | ||
---|---|---|
1244 | Thank you for the review! I will remove the TODO comment then. |
I agree that I do not see in which case we would currently generate a body with side effects. The only case I can think of is if we were to inline some "ordered" hlfir.elemental inside an hlfir.elemental_addr: the hlfir.elemental_addr should inherit the "ordered". But this is a risky optimization as there may be other Fortran rules to consider when doing this.
Having the attribute offers more flexibility, so I think it is fine to have it.