4
4
subroutine eoshift_test1 (arr , shift )
5
5
logical , dimension (3 ) :: arr, res
6
6
integer :: shift
7
- ! CHECK: %[[boundAlloc:.*]] = fir.alloca !fir.logical<4> {uniq_name = ""}
8
7
! CHECK: %[[resBox:.*]] = fir.alloca !fir.box<!fir.heap<!fir.array<?x!fir.logical<4>>>> {uniq_name = ""}
9
8
! CHECK: %[[res:.*]] = fir.alloca !fir.array<3x!fir.logical<4>> {bindc_name = "res", uniq_name = "_QFeoshift_test1Eres"}
10
9
! CHECK: %[[resLoad:.*]] = fir.array_load %[[res]]({{.*}}) : (!fir.ref<!fir.array<3x!fir.logical<4>>>, !fir.shape<1>) -> !fir.array<3x!fir.logical<4>>
11
10
! CHECK: %[[arr:.*]] = fir.embox %arg0({{.*}}) : (!fir.ref<!fir.array<3x!fir.logical<4>>>, !fir.shape<1>) -> !fir.box<!fir.array<3x!fir.logical<4>>>
12
11
! CHECK: %[[bits:.*]] = fir.zero_bits !fir.heap<!fir.array<?x!fir.logical<4>>>
13
12
! CHECK: %[[init:.*]] = fir.embox %[[bits]]({{.*}}) : (!fir.heap<!fir.array<?x!fir.logical<4>>>, !fir.shape<1>) -> !fir.box<!fir.heap<!fir.array<?x!fir.logical<4>>>>
14
13
! CHECK: fir.store %[[init]] to %[[resBox]] : !fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.logical<4>>>>>
15
- ! CHECK: %[[zero:.*]] = constant 0 : index
16
- ! CHECK: %[[false:.*]] = fir.convert %[[zero]] : (index) -> !fir.logical<4>
17
- ! CHECK: fir.store %[[false]] to %[[boundAlloc]] : !fir.ref<!fir.logical<4>>
18
- ! CHECK: %[[boundBox:.*]] = fir.embox %[[boundAlloc]] : (!fir.ref<!fir.logical<4>>) -> !fir.box<!fir.logical<4>>
14
+ ! CHECK: %[[boundBox:.*]] = fir.absent !fir.box<none>
19
15
! CHECK: %[[shift:.*]] = fir.load %arg1 : !fir.ref<i32>
20
16
21
17
res = eoshift (arr, shift)
22
18
23
19
! CHECK: %[[resIRBox:.*]] = fir.convert %[[resBox]] : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.logical<4>>>>>) -> !fir.ref<!fir.box<none>>
24
20
! CHECK: %[[arrBox:.*]] = fir.convert %[[arr]] : (!fir.box<!fir.array<3x!fir.logical<4>>>) -> !fir.box<none>
25
21
! CHECK: %[[shiftBox:.*]] = fir.convert %[[shift]] : (i32) -> i64
26
- ! CHECK: %[[boundBoxNone:.*]] = fir.convert %[[boundBox]] : (!fir.box<!fir.logical<4>>) -> !fir.box<none>
27
- ! CHECK: %[[tmp:.*]] = fir.call @_FortranAEoshiftVector(%[[resIRBox]], %[[arrBox]], %[[shiftBox]], %[[boundBoxNone]], {{.*}}, {{.*}}) : (!fir.ref<!fir.box<none>>, !fir.box<none>, i64, !fir.box<none>, !fir.ref<i8>, i32) -> none
22
+ ! CHECK: %[[tmp:.*]] = fir.call @_FortranAEoshiftVector(%[[resIRBox]], %[[arrBox]], %[[shiftBox]], %[[boundBox]], {{.*}}, {{.*}}) : (!fir.ref<!fir.box<none>>, !fir.box<none>, i64, !fir.box<none>, !fir.ref<i8>, i32) -> none
28
23
! CHECK: fir.array_merge_store %[[resLoad]], {{.*}} to %[[res]] : !fir.array<3x!fir.logical<4>>, !fir.array<3x!fir.logical<4>>, !fir.ref<!fir.array<3x!fir.logical<4>>>
29
24
end subroutine eoshift_test1
30
25
@@ -33,18 +28,15 @@ subroutine eoshift_test2(arr, shift, bound, dim)
33
28
integer , dimension (3 ,3 ) :: arr, res
34
29
integer , dimension (3 ) :: shift
35
30
integer :: bound, dim
36
- ! CHECK: %[[boundAlloc:.*]] = fir.alloca i32 {uniq_name = ""}
37
31
! CHECK: %[[resBox:.*]] = fir.alloca !fir.box<!fir.heap<!fir.array<?x?xi32>>> {uniq_name = ""}
38
32
! CHECK: %[[res:.*]] = fir.alloca !fir.array<3x3xi32> {bindc_name = "res", uniq_name = "_QFeoshift_test2Eres"}
39
33
! CHECK: %[[resLoad:.*]] = fir.array_load %[[res]]({{.*}}) : (!fir.ref<!fir.array<3x3xi32>>, !fir.shape<2>) -> !fir.array<3x3xi32>
40
- ! CHECK: %[[bound:.*]] = fir.load %arg2 : !fir.ref<i32>
41
34
! CHECK: %[[dim:.*]] = fir.load %arg3 : !fir.ref<i32>
42
35
43
36
res = eoshift (arr, shift, bound, dim)
44
37
45
38
! CHECK: %[[arr:.*]] = fir.embox %arg0({{.*}}) : (!fir.ref<!fir.array<3x3xi32>>, !fir.shape<2>) -> !fir.box<!fir.array<3x3xi32>>
46
- ! CHECK: fir.store %[[bound]] to %[[boundAlloc]] : !fir.ref<i32>
47
- ! CHECK: %[[boundBox:.*]] = fir.embox %[[boundAlloc]] : (!fir.ref<i32>) -> !fir.box<i32>
39
+ ! CHECK: %[[boundBox:.*]] = fir.embox %arg2 : (!fir.ref<i32>) -> !fir.box<i32>
48
40
! CHECK: %[[shiftBox:.*]] = fir.embox %arg1({{.*}}) : (!fir.ref<!fir.array<3xi32>>, !fir.shape<1>) -> !fir.box<!fir.array<3xi32>>
49
41
! CHECK: %[[resIRBox:.*]] = fir.convert %[[resBox]] : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x?xi32>>>>) -> !fir.ref<!fir.box<none>>
50
42
! CHECK: %[[arrBox:.*]] = fir.convert %[[arr]] : (!fir.box<!fir.array<3x3xi32>>) -> !fir.box<none>
@@ -70,23 +62,11 @@ subroutine eoshift_test3(arr, shift, dim)
70
62
71
63
res = eoshift (arr, SHIFT= shift, DIM= dim)
72
64
73
- ! CHECK: %[[boundAlloc:.*]] = fir.alloca !fir.char<1,4>
74
- ! CHECK: %[[zero:.*]] = constant 0 : index
75
- ! CHECK: %[[len:.*]] = constant 4 : index
76
- ! CHECK: %[[blankVal:.*]] = constant 32 : i8
77
- ! CHECK: %[[single:.*]] = fir.undefined !fir.char<1>
78
- ! CHECK: %[[blank:.*]] = fir.insert_value %[[single]], %[[blankVal]], [0 : index] : (!fir.char<1>, i8) -> !fir.char<1>
79
- ! CHECK: %[[one:.*]] = constant 1 : index
80
- ! CHECK: fir.do_loop %arg3 = %[[zero]] to %[[len]] step %[[one]] {
81
- ! CHECK: %[[bound:.*]] = fir.convert %[[boundAlloc]] : (!fir.ref<!fir.char<1,4>>) -> !fir.ref<!fir.array<4x!fir.char<1>>>
82
- ! CHECK: %[[index:.*]] = fir.coordinate_of %[[bound]], %arg3 : (!fir.ref<!fir.array<4x!fir.char<1>>>, index) -> !fir.ref<!fir.char<1>>
83
- ! CHECK: fir.store %[[blank]] to %[[index]] : !fir.ref<!fir.char<1>>
84
- ! CHECK: %[[boundBox:.*]] = fir.embox %[[boundAlloc]] : (!fir.ref<!fir.char<1,4>>) -> !fir.box<!fir.char<1,4>>
65
+ ! CHECK: %[[boundBox:.*]] = fir.absent !fir.box<none>
85
66
! CHECK: %[[shiftBox:.*]] = fir.embox %arg1 : (!fir.ref<i32>) -> !fir.box<i32>
86
67
! CHECK: %[[resIRBox:.*]] = fir.convert %[[resBox]] : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x?x!fir.char<1,?>>>>>) -> !fir.ref<!fir.box<none>>
87
68
! CHECK: %[[arrayBoxNone:.*]] = fir.convert %[[arrayBox]] : (!fir.box<!fir.array<3x3x!fir.char<1,4>>>) -> !fir.box<none>
88
69
! CHECK: %[[shiftBoxNone:.*]] = fir.convert %[[shiftBox]] : (!fir.box<i32>) -> !fir.box<none>
89
- ! CHECK: %[[boundBoxNone:.*]] = fir.convert %[[boundBox]] : (!fir.box<!fir.char<1,4>>) -> !fir.box<none>
90
- ! CHECK: %[[tmp:.*]] = fir.call @_FortranAEoshift(%[[resIRBox]], %[[arrayBoxNone]], %[[shiftBoxNone]], %[[boundBoxNone]], %[[dim]], {{.*}}, {{.*}}) : (!fir.ref<!fir.box<none>>, !fir.box<none>, !fir.box<none>, !fir.box<none>, i32, !fir.ref<i8>, i32) -> none
70
+ ! CHECK: %[[tmp:.*]] = fir.call @_FortranAEoshift(%[[resIRBox]], %[[arrayBoxNone]], %[[shiftBoxNone]], %[[boundBox]], %[[dim]], {{.*}}, {{.*}}) : (!fir.ref<!fir.box<none>>, !fir.box<none>, !fir.box<none>, !fir.box<none>, i32, !fir.ref<i8>, i32) -> none
91
71
! CHECK: fir.array_merge_store %[[resLoad]], {{.*}} to %[[res]] : !fir.array<3x3x!fir.char<1,4>>, !fir.array<3x3x!fir.char<1,4>>, !fir.ref<!fir.array<3x3x!fir.char<1,4>>>
92
72
end subroutine eoshift_test3
0 commit comments