[flang-commits] [flang] [flang] Fixed designator codegen for contiguous boxes. (PR #139003)
Slava Zakharin via flang-commits
flang-commits at lists.llvm.org
Fri May 9 10:01:13 PDT 2025
================
@@ -412,12 +412,44 @@ class DesignateOpConversion
auto indices = designate.getIndices();
int i = 0;
auto attrs = designate.getIsTripletAttr();
+
+ // If the shape specifies a shift and the base is not a box,
+ // then we have to subtract the lower bounds, as long as
+ // fir.array_coor does not support non-default lower bounds
+ // for non-box accesses.
----------------
vzakhari wrote:
I was hitting "shift can only be provided with fir.box memref" error in `fir::ArrayCoorOp::verify`, but I now see a comment there saying that the codegen does support it:
```
// TODO: it looks like PreCGRewrite and CodeGen can support
// fir.shift with plain array reference, so we may consider
// removing this check.
if (!mlir::isa<fir::BaseBoxType>(getMemref().getType()))
return emitOpError("shift can only be provided with fir.box memref");
```
I will do more investigation.
https://github.com/llvm/llvm-project/pull/139003
More information about the flang-commits
mailing list