@@ -56,14 +56,12 @@ func.func @fa(%a : !fir.ref<!fir.array<100xf32>>) {
56
56
// CHECK-LABEL: define void @b1(
57
57
// CHECK-SAME: ptr captures(none) %[[res:.*]], ptr captures(none) %[[arg0:.*]], i64 %[[arg1:.*]])
58
58
func.func @b1(%arg0 : !fir.ref<!fir.char<1,?>>, %arg1 : index) -> !fir.box<!fir.char<1,?>> {
59
- // CHECK: %[[alloca:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8 }
60
59
// CHECK: %[[size:.*]] = mul i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64), %[[arg1]]
61
60
// CHECK: insertvalue {{.*}} undef, i64 %[[size]], 1
62
61
// CHECK: insertvalue {{.*}} i32 20240719, 2
63
62
// CHECK: insertvalue {{.*}} ptr %[[arg0]], 0
64
63
%x = fir.embox %arg0 typeparams %arg1 : (!fir.ref<!fir.char<1,?>>, index) -> !fir.box<!fir.char<1,?>>
65
- // CHECK: store {{.*}}, ptr %[[alloca]]
66
- // CHECK: call void @llvm.memcpy.p0.p0.i32(ptr %[[res]], ptr %[[alloca]], i32 24, i1 false)
64
+ // CHECK: store {{.*}}, ptr %[[res]]
67
65
return %x : !fir.box<!fir.char<1,?>>
68
66
}
69
67
@@ -73,13 +71,11 @@ func.func @b1(%arg0 : !fir.ref<!fir.char<1,?>>, %arg1 : index) -> !fir.box<!fir.
73
71
// CHECK-SAME: ptr captures(none) %[[arg0:.*]], i64 %[[arg1:.*]])
74
72
func.func @b2(%arg0 : !fir.ref<!fir.array<?x!fir.char<1,5>>>, %arg1 : index) -> !fir.box<!fir.array<?x!fir.char<1,5>>> {
75
73
%1 = fir.shape %arg1 : (index) -> !fir.shape<1>
76
- // CHECK: %[[alloca:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }
77
74
// CHECK: insertvalue {{.*}} { ptr undef, i64 ptrtoint (ptr getelementptr ([5 x i8], ptr null, i32 1) to i64), i32 20240719, i8 1, i8 40, i8 0, i8 0, {{.*}} }, i64 %[[arg1]], 7, 0, 1
78
75
// CHECK: insertvalue {{.*}} %{{.*}}, i64 ptrtoint (ptr getelementptr ([5 x i8], ptr null, i32 1) to i64), 7, 0, 2
79
76
// CHECK: insertvalue {{.*}} ptr %[[arg0]], 0
80
77
%2 = fir.embox %arg0(%1) : (!fir.ref<!fir.array<?x!fir.char<1,5>>>, !fir.shape<1>) -> !fir.box<!fir.array<?x!fir.char<1,5>>>
81
- // CHECK: store {{.*}}, ptr %[[alloca]]
82
- // CHECK: call void @llvm.memcpy.p0.p0.i32(ptr %[[res]], ptr %[[alloca]], i32 48, i1 false)
78
+ // CHECK: store {{.*}}, ptr %[[res]]
83
79
return %2 : !fir.box<!fir.array<?x!fir.char<1,5>>>
84
80
}
85
81
@@ -88,16 +84,14 @@ func.func @b2(%arg0 : !fir.ref<!fir.array<?x!fir.char<1,5>>>, %arg1 : index) ->
88
84
// CHECK-SAME: ptr captures(none) %[[res:.*]], ptr captures(none) %[[arg0:.*]], i64 %[[arg1:.*]], i64 %[[arg2:.*]])
89
85
func.func @b3(%arg0 : !fir.ref<!fir.array<?x!fir.char<1,?>>>, %arg1 : index, %arg2 : index) -> !fir.box<!fir.array<?x!fir.char<1,?>>> {
90
86
%1 = fir.shape %arg2 : (index) -> !fir.shape<1>
91
- // CHECK: %[[alloca:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }
92
87
// CHECK: %[[size:.*]] = mul i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64), %[[arg1]]
93
88
// CHECK: insertvalue {{.*}} i64 %[[size]], 1
94
89
// CHECK: insertvalue {{.*}} i32 20240719, 2
95
90
// CHECK: insertvalue {{.*}} i64 %[[arg2]], 7, 0, 1
96
91
// CHECK: insertvalue {{.*}} i64 %[[size]], 7, 0, 2
97
92
// CHECK: insertvalue {{.*}} ptr %[[arg0]], 0
98
93
%2 = fir.embox %arg0(%1) typeparams %arg1 : (!fir.ref<!fir.array<?x!fir.char<1,?>>>, !fir.shape<1>, index) -> !fir.box<!fir.array<?x!fir.char<1,?>>>
99
- // CHECK: store {{.*}}, ptr %[[alloca]]
100
- // CHECK: call void @llvm.memcpy.p0.p0.i32(ptr %[[res]], ptr %[[alloca]], i32 48, i1 false)
94
+ // CHECK: store {{.*}}, ptr %[[res]]
101
95
return %2 : !fir.box<!fir.array<?x!fir.char<1,?>>>
102
96
}
103
97
@@ -107,16 +101,14 @@ func.func @b3(%arg0 : !fir.ref<!fir.array<?x!fir.char<1,?>>>, %arg1 : index, %ar
107
101
func.func @b4(%arg0 : !fir.ref<!fir.array<7x!fir.char<1,?>>>, %arg1 : index) -> !fir.box<!fir.array<7x!fir.char<1,?>>> {
108
102
%c_7 = arith.constant 7 : index
109
103
%1 = fir.shape %c_7 : (index) -> !fir.shape<1>
110
- // CHECK: %[[alloca:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }
111
104
// CHECK: %[[size:.*]] = mul i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64), %[[arg1]]
112
105
// CHECK: insertvalue {{.*}} i64 %[[size]], 1
113
106
// CHECK: insertvalue {{.*}} i32 20240719, 2
114
107
// CHECK: insertvalue {{.*}} i64 7, 7, 0, 1
115
108
// CHECK: insertvalue {{.*}} i64 %[[size]], 7, 0, 2
116
109
// CHECK: insertvalue {{.*}} ptr %[[arg0]], 0
117
110
%x = fir.embox %arg0(%1) typeparams %arg1 : (!fir.ref<!fir.array<7x!fir.char<1,?>>>, !fir.shape<1>, index) -> !fir.box<!fir.array<7x!fir.char<1,?>>>
118
- // CHECK: store {{.*}}, ptr %[[alloca]]
119
- // CHECK: call void @llvm.memcpy.p0.p0.i32(ptr %[[res]], ptr %[[alloca]], i32 48, i1 false)
111
+ // CHECK: store {{.*}}, ptr %[[res]]
120
112
return %x : !fir.box<!fir.array<7x!fir.char<1,?>>>
121
113
}
122
114
@@ -125,7 +117,8 @@ func.func @b4(%arg0 : !fir.ref<!fir.array<7x!fir.char<1,?>>>, %arg1 : index) ->
125
117
// CHECK-SAME: ptr captures(none) %[[arg0:.*]], ptr %[[arg1:.*]])
126
118
func.func @b5(%arg0 : !fir.ref<!fir.box<!fir.heap<!fir.array<?x?xf32>>>>, %arg1 : !fir.box<!fir.heap<!fir.array<?x?xf32>>>) {
127
119
fir.store %arg1 to %arg0 : !fir.ref<!fir.box<!fir.heap<!fir.array<?x?xf32>>>>
128
- // CHECK: call void @llvm.memcpy.p0.p0.i32(ptr %0, ptr %1, i32 72, i1 false)
120
+ // CHECK: %[[boxLoad:.*]] = load { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %[[arg1]]
121
+ // CHECK: store { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] } %[[boxLoad]], ptr %[[arg0]]
129
122
return
130
123
}
131
124
0 commit comments