Skip to content

Commit 1c8d7c5

Browse files
committed
Changed IsContiguousUpTo to accept int dim argument.
1 parent 7213313 commit 1c8d7c5

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

flang/include/flang/Runtime/support.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ bool RTDECL(IsContiguous)(const Descriptor &);
3636

3737
// Predicate: is the storage described by a Descriptor contiguous in memory
3838
// up to the given dimension?
39-
bool RTDECL(IsContiguousUpTo)(const Descriptor &, char);
39+
bool RTDECL(IsContiguousUpTo)(const Descriptor &, int);
4040

4141
// Predicate: is this descriptor describing an assumed-size array?
4242
bool RTDECL(IsAssumedSize)(const Descriptor &);

flang/lib/Optimizer/Transforms/SimplifyFIROperations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ mlir::LogicalResult IsContiguousBoxCoversion::matchAndRewrite(
9292
mlir::Value result;
9393
if (op.getInnermost()) {
9494
mlir::Value one =
95-
builder.createIntegerConstant(loc, builder.getI8Type(), 1);
95+
builder.createIntegerConstant(loc, builder.getI32Type(), 1);
9696
result =
9797
fir::runtime::genIsContiguousUpTo(builder, loc, op.getBox(), one);
9898
} else {

flang/test/Transforms/simplify-fir-operations.fir

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ func.func @test_none_innermost(%arg0: !fir.box<none>) -> i1 {
88
}
99
// CHECK-LABEL: func.func @test_none_innermost(
1010
// CHECK-SAME: %[[VAL_0:[0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*]]: !fir.box<none>) -> i1 {
11-
// CHECK: %[[VAL_1:.*]] = arith.constant 1 : i8
12-
// CHECK: %[[VAL_2:.*]] = fir.call @_FortranAIsContiguousUpTo(%[[VAL_0]], %[[VAL_1]]) : (!fir.box<none>, i8) -> i1
11+
// CHECK: %[[VAL_1:.*]] = arith.constant 1 : i32
12+
// CHECK: %[[VAL_2:.*]] = fir.call @_FortranAIsContiguousUpTo(%[[VAL_0]], %[[VAL_1]]) : (!fir.box<none>, i32) -> i1
1313
// CHECK: return %[[VAL_2]] : i1
1414
// CHECK: }
1515

@@ -33,9 +33,9 @@ func.func @test_array_innermost(%arg0: !fir.box<!fir.array<?xf32>>) -> i1 {
3333
}
3434
// CHECK-LABEL: func.func @test_array_innermost(
3535
// CHECK-SAME: %[[VAL_0:[0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*]]: !fir.box<!fir.array<?xf32>>) -> i1 {
36-
// CHECK: %[[VAL_1:.*]] = arith.constant 1 : i8
36+
// CHECK: %[[VAL_1:.*]] = arith.constant 1 : i32
3737
// CHECK: %[[VAL_2:.*]] = fir.convert %[[VAL_0]] : (!fir.box<!fir.array<?xf32>>) -> !fir.box<none>
38-
// CHECK: %[[VAL_3:.*]] = fir.call @_FortranAIsContiguousUpTo(%[[VAL_2]], %[[VAL_1]]) : (!fir.box<none>, i8) -> i1
38+
// CHECK: %[[VAL_3:.*]] = fir.call @_FortranAIsContiguousUpTo(%[[VAL_2]], %[[VAL_1]]) : (!fir.box<none>, i32) -> i1
3939
// CHECK: return %[[VAL_3]] : i1
4040
// CHECK: }
4141

@@ -60,9 +60,9 @@ func.func @test_assumed_rank_innermost(%arg0: !fir.box<!fir.array<*:f32>>) -> i1
6060
}
6161
// CHECK-LABEL: func.func @test_assumed_rank_innermost(
6262
// CHECK-SAME: %[[VAL_0:[0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*]]: !fir.box<!fir.array<*:f32>>) -> i1 {
63-
// CHECK: %[[VAL_1:.*]] = arith.constant 1 : i8
63+
// CHECK: %[[VAL_1:.*]] = arith.constant 1 : i32
6464
// CHECK: %[[VAL_2:.*]] = fir.convert %[[VAL_0]] : (!fir.box<!fir.array<*:f32>>) -> !fir.box<none>
65-
// CHECK: %[[VAL_3:.*]] = fir.call @_FortranAIsContiguousUpTo(%[[VAL_2]], %[[VAL_1]]) : (!fir.box<none>, i8) -> i1
65+
// CHECK: %[[VAL_3:.*]] = fir.call @_FortranAIsContiguousUpTo(%[[VAL_2]], %[[VAL_1]]) : (!fir.box<none>, i32) -> i1
6666
// CHECK: return %[[VAL_3]] : i1
6767
// CHECK: }
6868

0 commit comments

Comments
 (0)