Skip to content

Commit 795c3ad

Browse files
committed
Revert "[flang][OpenMP] Fix reduction of arrays with non-default lower bounds (llvm#132228)"
This reverts commit ef56f4b.
1 parent 704bbe8 commit 795c3ad

18 files changed

+75
-194
lines changed

flang/lib/Lower/OpenMP/PrivateReductionUtils.cpp

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -122,47 +122,25 @@ static void createCleanupRegion(Fortran::lower::AbstractConverter &converter,
122122
typeError();
123123
}
124124

125-
fir::ShapeShiftOp Fortran::lower::omp::getShapeShift(
126-
fir::FirOpBuilder &builder, mlir::Location loc, mlir::Value box,
127-
bool cannotHaveNonDefaultLowerBounds, bool useDefaultLowerBounds) {
125+
fir::ShapeShiftOp Fortran::lower::omp::getShapeShift(fir::FirOpBuilder &builder,
126+
mlir::Location loc,
127+
mlir::Value box) {
128128
fir::SequenceType sequenceType = mlir::cast<fir::SequenceType>(
129129
hlfir::getFortranElementOrSequenceType(box.getType()));
130130
const unsigned rank = sequenceType.getDimension();
131131
llvm::SmallVector<mlir::Value> lbAndExtents;
132132
lbAndExtents.reserve(rank * 2);
133133

134-
mlir::Value oneVal;
135-
auto one = [&] {
136-
if (!oneVal)
137-
oneVal = builder.createIntegerConstant(loc, idxTy, 1);
138-
return oneVal;
139-
};
140-
141-
if ((cannotHaveNonDefaultLowerBounds || useDefaultLowerBounds) &&
142-
!sequenceType.hasDynamicExtents()) {
143-
// We don't need fir::BoxDimsOp if all of the extents are statically known
144-
// and we can assume default lower bounds. This helps avoids reads from the
145-
// mold arg.
146-
// We may also want to use default lower bounds to iterate through array
147-
// elements without having to adjust each index.
148-
for (int64_t extent : sequenceType.getShape()) {
149-
assert(extent != sequenceType.getUnknownExtent());
150-
lbAndExtents.push_back(one());
151-
mlir::Value extentVal = builder.createIntegerConstant(loc, idxTy, extent);
152-
lbAndExtents.push_back(extentVal);
153-
}
154-
} else {
155-
for (unsigned i = 0; i < rank; ++i) {
156-
// TODO: ideally we want to hoist box reads out of the critical section.
157-
// We could do this by having box dimensions in block arguments like
158-
// OpenACC does
159-
mlir::Value dim = builder.createIntegerConstant(loc, idxTy, i);
160-
auto dimInfo =
161-
builder.create<fir::BoxDimsOp>(loc, idxTy, idxTy, idxTy, box, dim);
162-
lbAndExtents.push_back(useDefaultLowerBounds ? one()
163-
: dimInfo.getLowerBound());
164-
lbAndExtents.push_back(dimInfo.getExtent());
165-
}
134+
mlir::Type idxTy = builder.getIndexType();
135+
for (unsigned i = 0; i < rank; ++i) {
136+
// TODO: ideally we want to hoist box reads out of the critical section.
137+
// We could do this by having box dimensions in block arguments like
138+
// OpenACC does
139+
mlir::Value dim = builder.createIntegerConstant(loc, idxTy, i);
140+
auto dimInfo =
141+
builder.create<fir::BoxDimsOp>(loc, idxTy, idxTy, idxTy, box, dim);
142+
lbAndExtents.push_back(dimInfo.getLowerBound());
143+
lbAndExtents.push_back(dimInfo.getExtent());
166144
}
167145

168146
auto shapeShiftTy = fir::ShapeShiftType::get(builder.getContext(), rank);

flang/lib/Lower/OpenMP/PrivateReductionUtils.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,8 @@ void populateByRefInitAndCleanupRegions(
5858
const Fortran::semantics::Symbol *sym = nullptr);
5959

6060
/// Generate a fir::ShapeShift op describing the provided boxed array.
61-
/// `cannotHaveNonDefaultLowerBounds` should be set if `box` is known to have
62-
/// default lower bounds. This can improve code generation.
63-
/// `useDefaultLowerBounds` can be set to force the returned fir::ShapeShiftOp
64-
/// to have default lower bounds, which is useful to iterate through array
65-
/// elements without having to adjust each index.
6661
fir::ShapeShiftOp getShapeShift(fir::FirOpBuilder &builder, mlir::Location loc,
67-
mlir::Value box,
68-
bool cannotHaveNonDefaultLowerBounds = false,
69-
bool useDefaultLowerBounds = false);
62+
mlir::Value box);
7063

7164
} // namespace omp
7265
} // namespace lower

flang/lib/Lower/OpenMP/ReductionProcessor.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,7 @@ static void genBoxCombiner(fir::FirOpBuilder &builder, mlir::Location loc,
337337
return;
338338
}
339339

340-
// Get ShapeShift with default lower bounds. This makes it possible to use
341-
// unmodified LoopNest's indices with ArrayCoorOp.
342-
fir::ShapeShiftOp shapeShift =
343-
getShapeShift(builder, loc, lhs,
344-
/*cannotHaveNonDefaultLowerBounds=*/false,
345-
/*useDefaultLowerBounds=*/true);
340+
fir::ShapeShiftOp shapeShift = getShapeShift(builder, loc, lhs);
346341

347342
// Iterate over array elements, applying the equivalent scalar reduction:
348343

flang/test/Lower/OpenMP/parallel-reduction-allocatable-array.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ program reduce
5555
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_1]] : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>
5656
! CHECK: %[[VAL_4:.*]] = arith.constant 0 : index
5757
! CHECK: %[[VAL_5:.*]]:3 = fir.box_dims %[[VAL_2]], %[[VAL_4]] : (!fir.box<!fir.heap<!fir.array<?xi32>>>, index) -> (index, index, index)
58-
! CHECK: %[[C1:.*]] = arith.constant 1 : index
59-
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[C1]], %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
58+
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[VAL_5]]#0, %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
6059
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : index
6160
! CHECK: fir.do_loop %[[VAL_8:.*]] = %[[VAL_7]] to %[[VAL_5]]#1 step %[[VAL_7]] unordered {
6261
! CHECK: %[[VAL_9:.*]] = fir.array_coor %[[VAL_2]](%[[VAL_6]]) %[[VAL_8]] : (!fir.box<!fir.heap<!fir.array<?xi32>>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>

flang/test/Lower/OpenMP/parallel-reduction-array-lb.f90

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ program reduce
3737
! CHECK: ^bb0(%[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.array<3x2xi32>>>, %[[VAL_1:.*]]: !fir.ref<!fir.box<!fir.array<3x2xi32>>>):
3838
! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<!fir.box<!fir.array<3x2xi32>>>
3939
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_1]] : !fir.ref<!fir.box<!fir.array<3x2xi32>>>
40-
! CHECK: %[[C1:.*]] = arith.constant 1 : index
41-
! CHECK: %[[C3:.*]] = arith.constant 3 : index
42-
! CHECK: %[[C2:.*]] = arith.constant 2 : index
43-
! CHECK: %[[SHAPE_SHIFT:.*]] = fir.shape_shift %[[C1]], %[[C3]], %[[C1]], %[[C2]] : (index, index, index, index) -> !fir.shapeshift<2>
44-
! CHECK: %[[C1_0:.*]] = arith.constant 1 : index
45-
! CHECK: fir.do_loop %[[VAL_10:.*]] = %[[C1_0]] to %[[C2]] step %[[C1_0]] unordered {
46-
! CHECK: fir.do_loop %[[VAL_11:.*]] = %[[C1_0]] to %[[C3]] step %[[C1_0]] unordered {
47-
! CHECK: %[[VAL_12:.*]] = fir.array_coor %[[VAL_2]](%[[SHAPE_SHIFT]]) %[[VAL_11]], %[[VAL_10]] : (!fir.box<!fir.array<3x2xi32>>, !fir.shapeshift<2>, index, index) -> !fir.ref<i32>
48-
! CHECK: %[[VAL_13:.*]] = fir.array_coor %[[VAL_3]](%[[SHAPE_SHIFT]]) %[[VAL_11]], %[[VAL_10]] : (!fir.box<!fir.array<3x2xi32>>, !fir.shapeshift<2>, index, index) -> !fir.ref<i32>
40+
! CHECK: %[[VAL_4:.*]] = arith.constant 0 : index
41+
! CHECK: %[[VAL_5:.*]]:3 = fir.box_dims %[[VAL_2]], %[[VAL_4]] : (!fir.box<!fir.array<3x2xi32>>, index) -> (index, index, index)
42+
! CHECK: %[[VAL_6:.*]] = arith.constant 1 : index
43+
! CHECK: %[[VAL_7:.*]]:3 = fir.box_dims %[[VAL_2]], %[[VAL_6]] : (!fir.box<!fir.array<3x2xi32>>, index) -> (index, index, index)
44+
! CHECK: %[[VAL_8:.*]] = fir.shape_shift %[[VAL_5]]#0, %[[VAL_5]]#1, %[[VAL_7]]#0, %[[VAL_7]]#1 : (index, index, index, index) -> !fir.shapeshift<2>
45+
! CHECK: %[[VAL_9:.*]] = arith.constant 1 : index
46+
! CHECK: fir.do_loop %[[VAL_10:.*]] = %[[VAL_9]] to %[[VAL_7]]#1 step %[[VAL_9]] unordered {
47+
! CHECK: fir.do_loop %[[VAL_11:.*]] = %[[VAL_9]] to %[[VAL_5]]#1 step %[[VAL_9]] unordered {
48+
! CHECK: %[[VAL_12:.*]] = fir.array_coor %[[VAL_2]](%[[VAL_8]]) %[[VAL_11]], %[[VAL_10]] : (!fir.box<!fir.array<3x2xi32>>, !fir.shapeshift<2>, index, index) -> !fir.ref<i32>
49+
! CHECK: %[[VAL_13:.*]] = fir.array_coor %[[VAL_3]](%[[VAL_8]]) %[[VAL_11]], %[[VAL_10]] : (!fir.box<!fir.array<3x2xi32>>, !fir.shapeshift<2>, index, index) -> !fir.ref<i32>
4950
! CHECK: %[[VAL_14:.*]] = fir.load %[[VAL_12]] : !fir.ref<i32>
5051
! CHECK: %[[VAL_15:.*]] = fir.load %[[VAL_13]] : !fir.ref<i32>
5152
! CHECK: %[[VAL_16:.*]] = arith.addi %[[VAL_14]], %[[VAL_15]] : i32

flang/test/Lower/OpenMP/parallel-reduction-array.f90

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ program reduce
3636
! CHECK: ^bb0(%[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.array<3xi32>>>, %[[VAL_1:.*]]: !fir.ref<!fir.box<!fir.array<3xi32>>>):
3737
! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<!fir.box<!fir.array<3xi32>>>
3838
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_1]] : !fir.ref<!fir.box<!fir.array<3xi32>>>
39-
! CHECK: %[[C1:.*]] = arith.constant 1 : index
40-
! CHECK: %[[C3:.*]] = arith.constant 3 : index
41-
! CHECK: %[[SHAPE_SHIFT:.*]] = fir.shape_shift %[[C1]], %[[C3]] : (index, index) -> !fir.shapeshift<1>
42-
! CHECK: %[[C1_0:.*]] = arith.constant 1 : index
43-
! CHECK: fir.do_loop %[[VAL_8:.*]] = %[[C1_0]] to %[[C3]] step %[[C1_0]] unordered {
44-
! CHECK: %[[VAL_9:.*]] = fir.array_coor %[[VAL_2]](%[[SHAPE_SHIFT]]) %[[VAL_8]] : (!fir.box<!fir.array<3xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>
45-
! CHECK: %[[VAL_10:.*]] = fir.array_coor %[[VAL_3]](%[[SHAPE_SHIFT]]) %[[VAL_8]] : (!fir.box<!fir.array<3xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>
39+
! CHECK: %[[VAL_4:.*]] = arith.constant 0 : index
40+
! CHECK: %[[VAL_5:.*]]:3 = fir.box_dims %[[VAL_2]], %[[VAL_4]] : (!fir.box<!fir.array<3xi32>>, index) -> (index, index, index)
41+
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[VAL_5]]#0, %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
42+
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : index
43+
! CHECK: fir.do_loop %[[VAL_8:.*]] = %[[VAL_7]] to %[[VAL_5]]#1 step %[[VAL_7]] unordered {
44+
! CHECK: %[[VAL_9:.*]] = fir.array_coor %[[VAL_2]](%[[VAL_6]]) %[[VAL_8]] : (!fir.box<!fir.array<3xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>
45+
! CHECK: %[[VAL_10:.*]] = fir.array_coor %[[VAL_3]](%[[VAL_6]]) %[[VAL_8]] : (!fir.box<!fir.array<3xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>
4646
! CHECK: %[[VAL_11:.*]] = fir.load %[[VAL_9]] : !fir.ref<i32>
4747
! CHECK: %[[VAL_12:.*]] = fir.load %[[VAL_10]] : !fir.ref<i32>
4848
! CHECK: %[[VAL_13:.*]] = arith.addi %[[VAL_11]], %[[VAL_12]] : i32

flang/test/Lower/OpenMP/parallel-reduction-array2.f90

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ program reduce
3535
! CHECK: ^bb0(%[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.array<3xi32>>>, %[[VAL_1:.*]]: !fir.ref<!fir.box<!fir.array<3xi32>>>):
3636
! CHECK: %[[VAL_2:.*]] = fir.load %[[VAL_0]] : !fir.ref<!fir.box<!fir.array<3xi32>>>
3737
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_1]] : !fir.ref<!fir.box<!fir.array<3xi32>>>
38-
! CHECK: %[[C1:.*]] = arith.constant 1 : index
39-
! CHECK: %[[C3:.*]] = arith.constant 3 : index
40-
! CHECK: %[[SHAPE_SHIFT:.*]] = fir.shape_shift %[[C1]], %[[C3]] : (index, index) -> !fir.shapeshift<1>
41-
! CHECK: %[[C1_0:.*]] = arith.constant 1 : index
42-
! CHECK: fir.do_loop %[[VAL_8:.*]] = %[[C1_0]] to %[[C3]] step %[[C1_0]] unordered {
43-
! CHECK: %[[VAL_9:.*]] = fir.array_coor %[[VAL_2]](%[[SHAPE_SHIFT]]) %[[VAL_8]] : (!fir.box<!fir.array<3xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>
44-
! CHECK: %[[VAL_10:.*]] = fir.array_coor %[[VAL_3]](%[[SHAPE_SHIFT]]) %[[VAL_8]] : (!fir.box<!fir.array<3xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>
38+
! CHECK: %[[VAL_4:.*]] = arith.constant 0 : index
39+
! CHECK: %[[VAL_5:.*]]:3 = fir.box_dims %[[VAL_2]], %[[VAL_4]] : (!fir.box<!fir.array<3xi32>>, index) -> (index, index, index)
40+
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[VAL_5]]#0, %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
41+
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : index
42+
! CHECK: fir.do_loop %[[VAL_8:.*]] = %[[VAL_7]] to %[[VAL_5]]#1 step %[[VAL_7]] unordered {
43+
! CHECK: %[[VAL_9:.*]] = fir.array_coor %[[VAL_2]](%[[VAL_6]]) %[[VAL_8]] : (!fir.box<!fir.array<3xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>
44+
! CHECK: %[[VAL_10:.*]] = fir.array_coor %[[VAL_3]](%[[VAL_6]]) %[[VAL_8]] : (!fir.box<!fir.array<3xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>
4545
! CHECK: %[[VAL_11:.*]] = fir.load %[[VAL_9]] : !fir.ref<i32>
4646
! CHECK: %[[VAL_12:.*]] = fir.load %[[VAL_10]] : !fir.ref<i32>
4747
! CHECK: %[[VAL_13:.*]] = arith.addi %[[VAL_11]], %[[VAL_12]] : i32

flang/test/Lower/OpenMP/parallel-reduction-pointer-array.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ program reduce
5656
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_1]] : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>
5757
! CHECK: %[[VAL_4:.*]] = arith.constant 0 : index
5858
! CHECK: %[[VAL_5:.*]]:3 = fir.box_dims %[[VAL_2]], %[[VAL_4]] : (!fir.box<!fir.ptr<!fir.array<?xi32>>>, index) -> (index, index, index)
59-
! CHECK: %[[C1:.*]] = arith.constant 1 : index
60-
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[C1]], %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
59+
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[VAL_5]]#0, %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
6160
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : index
6261
! CHECK: fir.do_loop %[[VAL_8:.*]] = %[[VAL_7]] to %[[VAL_5]]#1 step %[[VAL_7]] unordered {
6362
! CHECK: %[[VAL_9:.*]] = fir.array_coor %[[VAL_2]](%[[VAL_6]]) %[[VAL_8]] : (!fir.box<!fir.ptr<!fir.array<?xi32>>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>

flang/test/Lower/OpenMP/parallel-reduction3.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_1]] : !fir.ref<!fir.box<!fir.array<?xi32>>>
2727
! CHECK: %[[VAL_4:.*]] = arith.constant 0 : index
2828
! CHECK: %[[VAL_5:.*]]:3 = fir.box_dims %[[VAL_2]], %[[VAL_4]] : (!fir.box<!fir.array<?xi32>>, index) -> (index, index, index)
29-
! CHECK: %[[C1:.*]] = arith.constant 1 : index
30-
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[C1]], %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
29+
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[VAL_5]]#0, %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
3130
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : index
3231
! CHECK: fir.do_loop %[[VAL_8:.*]] = %[[VAL_7]] to %[[VAL_5]]#1 step %[[VAL_7]] unordered {
3332
! CHECK: %[[VAL_9:.*]] = fir.array_coor %[[VAL_2]](%[[VAL_6]]) %[[VAL_8]] : (!fir.box<!fir.array<?xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>

flang/test/Lower/OpenMP/reduction-array-intrinsic.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ subroutine max_array_reduction(l, r)
3434
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_1]] : !fir.ref<!fir.box<!fir.array<?xi32>>>
3535
! CHECK: %[[VAL_4:.*]] = arith.constant 0 : index
3636
! CHECK: %[[VAL_5:.*]]:3 = fir.box_dims %[[VAL_2]], %[[VAL_4]] : (!fir.box<!fir.array<?xi32>>, index) -> (index, index, index)
37-
! CHECK: %[[C1:.*]] = arith.constant 1 : index
38-
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[C1]], %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
37+
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[VAL_5]]#0, %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
3938
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : index
4039
! CHECK: fir.do_loop %[[VAL_8:.*]] = %[[VAL_7]] to %[[VAL_5]]#1 step %[[VAL_7]] unordered {
4140
! CHECK: %[[VAL_9:.*]] = fir.array_coor %[[VAL_2]](%[[VAL_6]]) %[[VAL_8]] : (!fir.box<!fir.array<?xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>

flang/test/Lower/OpenMP/wsloop-reduction-allocatable-array-minmax.f90

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ program reduce15
6969
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_1]] : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>
7070
! CHECK: %[[VAL_4:.*]] = arith.constant 0 : index
7171
! CHECK: %[[VAL_5:.*]]:3 = fir.box_dims %[[VAL_2]], %[[VAL_4]] : (!fir.box<!fir.heap<!fir.array<?xi32>>>, index) -> (index, index, index)
72-
! CHECK: %[[C1:.*]] = arith.constant 1 : index
73-
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[C1]], %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
72+
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[VAL_5]]#0, %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
7473
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : index
7574
! CHECK: fir.do_loop %[[VAL_8:.*]] = %[[VAL_7]] to %[[VAL_5]]#1 step %[[VAL_7]] unordered {
7675
! CHECK: %[[VAL_9:.*]] = fir.array_coor %[[VAL_2]](%[[VAL_6]]) %[[VAL_8]] : (!fir.box<!fir.heap<!fir.array<?xi32>>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>
@@ -131,8 +130,7 @@ program reduce15
131130
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_1]] : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>
132131
! CHECK: %[[VAL_4:.*]] = arith.constant 0 : index
133132
! CHECK: %[[VAL_5:.*]]:3 = fir.box_dims %[[VAL_2]], %[[VAL_4]] : (!fir.box<!fir.heap<!fir.array<?xi32>>>, index) -> (index, index, index)
134-
! CHECK: %[[C1:.*]] = arith.constant 1 : index
135-
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[C1]], %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
133+
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[VAL_5]]#0, %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
136134
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : index
137135
! CHECK: fir.do_loop %[[VAL_8:.*]] = %[[VAL_7]] to %[[VAL_5]]#1 step %[[VAL_7]] unordered {
138136
! CHECK: %[[VAL_9:.*]] = fir.array_coor %[[VAL_2]](%[[VAL_6]]) %[[VAL_8]] : (!fir.box<!fir.heap<!fir.array<?xi32>>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>

flang/test/Lower/OpenMP/wsloop-reduction-array-assumed-shape.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ subroutine reduce(r)
4747
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_1]] : !fir.ref<!fir.box<!fir.array<?xf64>>>
4848
! CHECK: %[[VAL_4:.*]] = arith.constant 0 : index
4949
! CHECK: %[[VAL_5:.*]]:3 = fir.box_dims %[[VAL_2]], %[[VAL_4]] : (!fir.box<!fir.array<?xf64>>, index) -> (index, index, index)
50-
! CHECK: %[[C1:.*]] = arith.constant 1 : index
51-
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[C1]], %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
50+
! CHECK: %[[VAL_6:.*]] = fir.shape_shift %[[VAL_5]]#0, %[[VAL_5]]#1 : (index, index) -> !fir.shapeshift<1>
5251
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : index
5352
! CHECK: fir.do_loop %[[VAL_8:.*]] = %[[VAL_7]] to %[[VAL_5]]#1 step %[[VAL_7]] unordered {
5453
! CHECK: %[[VAL_9:.*]] = fir.array_coor %[[VAL_2]](%[[VAL_6]]) %[[VAL_8]] : (!fir.box<!fir.array<?xf64>>, !fir.shapeshift<1>, index) -> !fir.ref<f64>

flang/test/Lower/OpenMP/wsloop-reduction-array-lb.f90

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)