[PATCH] D113092: [fir] Restrict array type on fir.insert_on_range

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 13:22:44 PDT 2021


clementval marked 2 inline comments as done.
clementval added inline comments.


================
Comment at: flang/lib/Optimizer/Dialect/FIROps.cpp:1392
+      fir::sequenceWithNonConstantShape(
+          op.seq().getType().cast<fir::SequenceType>()))
+    return op.emitOpError("must have constant shape and size");
----------------
mehdi_amini wrote:
> mehdi_amini wrote:
> > 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
> Oh also please update the doc for the op in the ODS definition 
Yes `sequenceWithNonConstantShape ` is included in `hasDynamicSize`.

ODS definition updated. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113092/new/

https://reviews.llvm.org/D113092



More information about the llvm-commits mailing list