File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -2473,7 +2473,9 @@ struct XArrayCoorOpConversion
2473
2473
// The array was not boxed, so it must be contiguous. offset is therefore an
2474
2474
// element offset and the base type is kept in the GEP unless the element
2475
2475
// type size is itself dynamic.
2476
- mlir::Type gepObjectType;
2476
+ mlir::Type objectTy = fir::unwrapRefType (coor.getMemref ().getType ());
2477
+ mlir::Type eleType = fir::unwrapSequenceType (objectTy);
2478
+ mlir::Type gepObjectType = convertType (eleType);
2477
2479
llvm::SmallVector<mlir::LLVM::GEPArg> args;
2478
2480
;
2479
2481
if (coor.getSubcomponent ().empty ()) {
@@ -2492,17 +2494,10 @@ struct XArrayCoorOpConversion
2492
2494
TODO (loc, " compute size of derived type with type parameters" );
2493
2495
}
2494
2496
}
2495
- gepObjectType =
2496
- convertType (fir::unwrapRefType (coor.getMemref ().getType ()));
2497
2497
args.push_back (offset);
2498
2498
} else {
2499
2499
// There are subcomponents.
2500
2500
args.push_back (offset);
2501
- // Operand #0 must have a pointer type. For subcomponent slicing, we
2502
- // want to cast away the array type and have a plain struct type.
2503
- mlir::Type objectTy = fir::unwrapRefType (coor.getMemref ().getType ());
2504
- mlir::Type eleType = fir::unwrapSequenceType (objectTy);
2505
- gepObjectType = convertType (eleType);
2506
2501
llvm::SmallVector<mlir::Value> indices = convertSubcomponentIndices (
2507
2502
loc, gepObjectType,
2508
2503
operands.slice (coor.subcomponentOffset (),
Original file line number Diff line number Diff line change @@ -2121,7 +2121,7 @@ func.func @ext_array_coor4(%arg0: !fir.ref<!fir.array<100xi32>>) {
2121
2121
// CHECK: %[[DIFF1:.*]] = llvm.add %[[DIFF0]], %[[ADJ]] : i64
2122
2122
// CHECK: %[[STRIDE:.*]] = llvm.mul %[[DIFF1]], %[[C1_1]] : i64
2123
2123
// CHECK: %[[OFFSET:.*]] = llvm.add %[[STRIDE]], %[[C0_1]] : i64
2124
- // CHECK: %{{.*}} = llvm.getelementptr %[[ARG0]][%[[OFFSET]]] : (!llvm.ptr, i64) -> !llvm.ptr, !llvm.array<100 x i32>
2124
+ // CHECK: %{{.*}} = llvm.getelementptr %[[ARG0]][%[[OFFSET]]] : (!llvm.ptr, i64) -> !llvm.ptr, i32
2125
2125
2126
2126
// Conversion with index type shape and slice
2127
2127
You can’t perform that action at this time.
0 commit comments