@@ -18,25 +18,21 @@ subroutine acc_enter_data
18
18
! $acc enter data create(a)
19
19
! CHECK: %[[ONE:.*]] = arith.constant 1 : index
20
20
! CHECK: %[[LB:.*]] = arith.constant 0 : index
21
- ! CHECK: %[[LBEXT:.*]] = arith.addi %[[C10]], %[[ONE]] : index
22
- ! CHECK: %[[UB:.*]] = arith.subi %[[LBEXT]], %[[ONE]] : index
21
+ ! CHECK: %[[UB:.*]] = arith.subi %[[C10]], %[[ONE]] : index
23
22
! CHECK: %[[BOUND0:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB]] : index) stride(%[[ONE]] : index) startIdx(%[[ONE]] : index)
24
23
! CHECK: %[[LB:.*]] = arith.constant 0 : index
25
- ! CHECK: %[[LBEXT:.*]] = arith.addi %[[EXTENT_C10]], %[[ONE]] : index
26
- ! CHECK: %[[UB:.*]] = arith.subi %[[LBEXT]], %[[ONE]] : index
24
+ ! CHECK: %[[UB:.*]] = arith.subi %[[EXTENT_C10]], %[[ONE]] : index
27
25
! CHECK: %[[BOUND1:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB]] : index) stride(%[[ONE]] : index) startIdx(%[[ONE]] : index)
28
26
! CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%[[BOUND0]], %[[BOUND1]]) -> !fir.ref<!fir.array<10x10xf32>> {name = "a", structured = false}
29
27
! CHECK: acc.enter_data dataOperands(%[[CREATE_A]] : !fir.ref<!fir.array<10x10xf32>>){{$}}
30
28
31
29
! $acc enter data create(a) if(.true.)
32
30
! CHECK: %[[ONE:.*]] = arith.constant 1 : index
33
31
! CHECK: %[[LB:.*]] = arith.constant 0 : index
34
- ! CHECK: %[[LBEXT:.*]] = arith.addi %[[C10]], %[[ONE]] : index
35
- ! CHECK: %[[UB:.*]] = arith.subi %[[LBEXT]], %[[ONE]] : index
32
+ ! CHECK: %[[UB:.*]] = arith.subi %[[C10]], %[[ONE]] : index
36
33
! CHECK: %[[BOUND0:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB]] : index) stride(%[[ONE]] : index) startIdx(%[[ONE]] : index)
37
34
! CHECK: %[[LB:.*]] = arith.constant 0 : index
38
- ! CHECK: %[[LBEXT:.*]] = arith.addi %[[EXTENT_C10]], %[[ONE]] : index
39
- ! CHECK: %[[UB:.*]] = arith.subi %[[LBEXT]], %[[ONE]] : index
35
+ ! CHECK: %[[UB:.*]] = arith.subi %[[EXTENT_C10]], %[[ONE]] : index
40
36
! CHECK: %[[BOUND1:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB]] : index) stride(%[[ONE]] : index) startIdx(%[[ONE]] : index)
41
37
! CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%[[BOUND0]], %[[BOUND1]]) -> !fir.ref<!fir.array<10x10xf32>> {name = "a", structured = false}
42
38
! CHECK: [[IF1:%.*]] = arith.constant true
@@ -45,12 +41,10 @@ subroutine acc_enter_data
45
41
! $acc enter data create(a) if(ifCondition)
46
42
! CHECK: %[[ONE:.*]] = arith.constant 1 : index
47
43
! CHECK: %[[LB:.*]] = arith.constant 0 : index
48
- ! CHECK: %[[LBEXT:.*]] = arith.addi %[[C10]], %[[ONE]] : index
49
- ! CHECK: %[[UB:.*]] = arith.subi %[[LBEXT]], %[[ONE]] : index
44
+ ! CHECK: %[[UB:.*]] = arith.subi %[[C10]], %[[ONE]] : index
50
45
! CHECK: %[[BOUND0:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB]] : index) stride(%[[ONE]] : index) startIdx(%[[ONE]] : index)
51
46
! CHECK: %[[LB:.*]] = arith.constant 0 : index
52
- ! CHECK: %[[LBEXT:.*]] = arith.addi %[[EXTENT_C10]], %[[ONE]] : index
53
- ! CHECK: %[[UB:.*]] = arith.subi %[[LBEXT]], %[[ONE]] : index
47
+ ! CHECK: %[[UB:.*]] = arith.subi %[[EXTENT_C10]], %[[ONE]] : index
54
48
! CHECK: %[[BOUND1:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB]] : index) stride(%[[ONE]] : index) startIdx(%[[ONE]] : index)
55
49
! CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%[[BOUND0]], %[[BOUND1]]) -> !fir.ref<!fir.array<10x10xf32>> {name = "a", structured = false}
56
50
! CHECK: [[IFCOND:%.*]] = fir.load %{{.*}} : !fir.ref<!fir.logical<4>>
@@ -266,6 +260,7 @@ subroutine acc_enter_data_dummy(a, b, n, m)
266
260
! Test lowering of array section for non default lower bound.
267
261
subroutine acc_enter_data_non_default_lb ()
268
262
integer :: a(0 :9 )
263
+ integer :: b(11 :20 )
269
264
270
265
! CHECK-LABEL: func.func @_QPacc_enter_data_non_default_lb() {
271
266
! CHECK: %[[BASELB:.*]] = arith.constant 0 : index
@@ -306,6 +301,14 @@ subroutine acc_enter_data_non_default_lb()
306
301
! CHECK: %[[UB:.*]] = arith.subi %[[LBEXT]], %[[ONE]] : index
307
302
! CHECK: %[[BOUND:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB]] : index) stride(%[[ONE]] : index) startIdx(%[[BASELB]] : index)
308
303
! CHECK: %[[CREATE:.*]] = acc.create varPtr(%[[A]] : !fir.ref<!fir.array<10xi32>>) bounds(%[[BOUND]]) -> !fir.ref<!fir.array<10xi32>> {name = "a(4:)", structured = false}
304
+ ! CHECK: acc.enter_data dataOperands(%[[CREATE]] : !fir.ref<!fir.array<10xi32>>)
305
+
306
+ ! $acc enter data create(b)
307
+ ! CHECK: %[[ONE:.*]] = arith.constant 1 : index
308
+ ! CHECK: %[[LB:.*]] = arith.constant 0 : index
309
+ ! CHECK: %[[UB:.*]] = arith.subi %c10{{.*}}, %[[ONE]] : index
310
+ ! CHECK: %[[BOUND:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB]] : index) stride(%[[ONE]] : index) startIdx(%c11{{.*}} : index)
311
+ ! CHECK: %[[CREATE:.*]] = acc.create varPtr(%1 : !fir.ref<!fir.array<10xi32>>) bounds(%[[BOUND]]) -> !fir.ref<!fir.array<10xi32>> {name = "b", structured = false}
309
312
! CHECK: acc.enter_data dataOperands(%[[CREATE]] : !fir.ref<!fir.array<10xi32>>)
310
313
311
314
end subroutine
@@ -598,8 +601,7 @@ subroutine acc_enter_data_derived_type()
598
601
! CHECK: %[[C10:.*]] = arith.constant 10 : index
599
602
! CHECK: %[[C1:.*]] = arith.constant 1 : index
600
603
! CHECK: %[[LB:.*]] = arith.constant 0 : index
601
- ! CHECK: %[[LBEXT:.*]] = arith.addi %[[C10]], %[[C1]] : index
602
- ! CHECK: %[[UB:.*]] = arith.subi %[[LBEXT]], %[[C1]] : index
604
+ ! CHECK: %[[UB:.*]] = arith.subi %[[C10]], %[[C1]] : index
603
605
! CHECK: %[[BOUND:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB]] : index) stride(%[[C1]] : index) startIdx(%[[C1]] : index)
604
606
! CHECK: %[[CREATE:.*]] = acc.create varPtr(%[[ARRAY_COORD]] : !fir.ref<!fir.array<10xf32>>) bounds(%[[BOUND]]) -> !fir.ref<!fir.array<10xf32>> {name = "a%array", structured = false}
605
607
! CHECK: acc.enter_data dataOperands(%[[CREATE]] : !fir.ref<!fir.array<10xf32>>)
@@ -655,8 +657,7 @@ subroutine acc_enter_data_derived_type()
655
657
! CHECK: %[[C10:.*]] = arith.constant 10 : index
656
658
! CHECK: %[[C1:.*]] = arith.constant 1 : index
657
659
! CHECK: %[[LB:.*]] = arith.constant 0 : index
658
- ! CHECK: %[[LBEXT:.*]] = arith.addi %[[C10]], %[[C1]] : index
659
- ! CHECK: %[[UB:.*]] = arith.subi %[[LBEXT]], %[[C1]] : index
660
+ ! CHECK: %[[UB:.*]] = arith.subi %[[C10]], %[[C1]] : index
660
661
! CHECK: %[[BOUND:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB]] : index) stride(%[[C1]] : index) startIdx(%[[C1]] : index)
661
662
! CHECK: %[[CREATE:.*]] = acc.create varPtr(%[[ARRAY_COORD]] : !fir.ref<!fir.array<10xf32>>) bounds(%[[BOUND]]) -> !fir.ref<!fir.array<10xf32>> {name = "b%d%array", structured = false}
662
663
@@ -687,8 +688,7 @@ subroutine acc_enter_data_derived_type()
687
688
! CHECK: %[[C10:.*]] = arith.constant 10 : index
688
689
! CHECK: %[[C1:.*]] = arith.constant 1 : index
689
690
! CHECK: %[[LB:.*]] = arith.constant 0 : index
690
- ! CHECK: %[[LBEXT:.*]] = arith.addi %[[C10]], %[[C1]] : index
691
- ! CHECK: %[[UB:.*]] = arith.subi %[[LBEXT]], %[[C1]] : index
691
+ ! CHECK: %[[UB:.*]] = arith.subi %[[C10]], %[[C1]] : index
692
692
! CHECK: %[[BOUND:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB]] : index) stride(%[[C1]] : index) startIdx(%[[C1]] : index)
693
693
! CHECK: %[[CREATE:.*]] = acc.create varPtr(%[[ARRAY_COORD]] : !fir.ref<!fir.array<10xf32>>) bounds(%[[BOUND]]) -> !fir.ref<!fir.array<10xf32>> {name = "d%d(1_8)%array", structured = false}
694
694
! CHECK: acc.enter_data dataOperands(%[[CREATE]] : !fir.ref<!fir.array<10xf32>>)
0 commit comments