Page MenuHomePhabricator

[fir] Restrict array type on fir.insert_on_range
ClosedPublic

Authored by clementval on Nov 3 2021, 3:04 AM.

Details

Summary

Sequence type had no restriction on the insert_on_range operation.
This patch adds a restriction for the type to have constant shape
and size.

Diff Detail

Event Timeline

clementval created this revision.Nov 3 2021, 3:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2021, 3:04 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Nov 3 2021, 3:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2021, 3:04 AM
mehdi_amini added inline comments.Nov 3 2021, 12:59 PM
flang/lib/Optimizer/Dialect/FIROps.cpp
1392

Isn't this second check already covered by hasDynamicSize?
The code there starts with:

if (auto arr = t.dyn_cast<fir::SequenceType>()) {
   if (sequenceWithNonConstantShape(arr))
     return true;

LG otherwise

1392

Oh also please update the doc for the op in the ODS definition

clementval updated this revision to Diff 384568.Nov 3 2021, 1:21 PM

ddress review comments

clementval marked 2 inline comments as done.Nov 3 2021, 1:22 PM
clementval added inline comments.
flang/lib/Optimizer/Dialect/FIROps.cpp
1392

Yes sequenceWithNonConstantShape is included in hasDynamicSize.

ODS definition updated.

mehdi_amini accepted this revision.Nov 3 2021, 10:51 PM
This revision is now accepted and ready to land.Nov 3 2021, 10:51 PM
This revision was automatically updated to reflect the committed changes.
clementval marked an inline comment as done.