@@ -19,14 +19,14 @@ func.func @alloca_scalars_nonchar() -> !fir.ref<i32> {
1919}
2020
2121// CHECK-LABEL: define ptr @allocmem_scalar_nonchar(
22- // CHECK: call ptr @malloc(i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64) )
22+ // CHECK: call ptr @malloc(i64 4 )
2323func.func @allocmem_scalar_nonchar() -> !fir.heap<i32> {
2424 %1 = fir.allocmem i32
2525 return %1 : !fir.heap<i32>
2626}
2727
2828// CHECK-LABEL: define ptr @allocmem_scalars_nonchar(
29- // CHECK: call ptr @malloc(i64 mul (i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64), i64 100) )
29+ // CHECK: call ptr @malloc(i64 400 )
3030func.func @allocmem_scalars_nonchar() -> !fir.heap<i32> {
3131 %0 = arith.constant 100 : index
3232 %1 = fir.allocmem i32 , %0
@@ -48,14 +48,14 @@ func.func @alloca_scalar_char_kind() -> !fir.ref<!fir.char<2,10>> {
4848}
4949
5050// CHECK-LABEL: define ptr @allocmem_scalar_char(
51- // CHECK: call ptr @malloc(i64 ptrtoint (ptr getelementptr ([10 x i8], ptr null, i32 1) to i64) )
51+ // CHECK: call ptr @malloc(i64 10 )
5252func.func @allocmem_scalar_char() -> !fir.heap<!fir.char<1,10>> {
5353 %1 = fir.allocmem !fir.char<1,10>
5454 return %1 : !fir.heap<!fir.char<1,10>>
5555}
5656
5757// CHECK-LABEL: define ptr @allocmem_scalar_char_kind(
58- // CHECK: call ptr @malloc(i64 ptrtoint (ptr getelementptr ([10 x i16], ptr null, i32 1) to i64) )
58+ // CHECK: call ptr @malloc(i64 20 )
5959func.func @allocmem_scalar_char_kind() -> !fir.heap<!fir.char<2,10>> {
6060 %1 = fir.allocmem !fir.char<2,10>
6161 return %1 : !fir.heap<!fir.char<2,10>>
@@ -82,7 +82,7 @@ func.func @alloca_scalar_dynchar_kind(%l : i32) -> !fir.ref<!fir.char<2,?>> {
8282// CHECK-LABEL: define ptr @allocmem_scalar_dynchar(
8383// CHECK-SAME: i32 %[[len:.*]])
8484// CHECK: %[[mul1:.*]] = sext i32 %[[len]] to i64
85- // CHECK: %[[mul2:.*]] = mul i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64) , %[[mul1]]
85+ // CHECK: %[[mul2:.*]] = mul i64 1 , %[[mul1]]
8686// CHECK: call ptr @malloc(i64 %[[mul2]])
8787func.func @allocmem_scalar_dynchar(%l : i32) -> !fir.heap<!fir.char<1,?>> {
8888 %1 = fir.allocmem !fir.char<1,?>(%l : i32)
@@ -92,7 +92,7 @@ func.func @allocmem_scalar_dynchar(%l : i32) -> !fir.heap<!fir.char<1,?>> {
9292// CHECK-LABEL: define ptr @allocmem_scalar_dynchar_kind(
9393// CHECK-SAME: i32 %[[len:.*]])
9494// CHECK: %[[mul1:.*]] = sext i32 %[[len]] to i64
95- // CHECK: %[[mul2:.*]] = mul i64 ptrtoint (ptr getelementptr (i16, ptr null, i32 1) to i64) , %[[mul1]]
95+ // CHECK: %[[mul2:.*]] = mul i64 2 , %[[mul1]]
9696// CHECK: call ptr @malloc(i64 %[[mul2]])
9797func.func @allocmem_scalar_dynchar_kind(%l : i32) -> !fir.heap<!fir.char<2,?>>{
9898 %1 = fir.allocmem !fir.char<2,?>(%l : i32)
@@ -131,14 +131,14 @@ func.func @alloca_array_of_dynchar(%l: i32) -> !fir.ref<!fir.array<3x3x!fir.char
131131}
132132
133133// CHECK-LABEL: define ptr @allocmem_array_of_nonchar(
134- // CHECK: call ptr @malloc(i64 ptrtoint (ptr getelementptr ([3 x [3 x i32]], ptr null, i32 1) to i64) )
134+ // CHECK: call ptr @malloc(i64 36 )
135135func.func @allocmem_array_of_nonchar() -> !fir.heap<!fir.array<3x3xi32>> {
136136 %1 = fir.allocmem !fir.array<3x3xi32>
137137 return %1 : !fir.heap<!fir.array<3x3xi32>>
138138}
139139
140140// CHECK-LABEL: define ptr @allocmem_array_of_char(
141- // CHECK: call ptr @malloc(i64 ptrtoint (ptr getelementptr ([3 x [3 x [10 x i8]]], ptr null, i32 1) to i64) )
141+ // CHECK: call ptr @malloc(i64 90 )
142142func.func @allocmem_array_of_char() -> !fir.heap<!fir.array<3x3x!fir.char<1,10>>> {
143143 %1 = fir.allocmem !fir.array<3x3x!fir.char<1,10>>
144144 return %1 : !fir.heap<!fir.array<3x3x!fir.char<1,10>>>
@@ -147,7 +147,7 @@ func.func @allocmem_array_of_char() -> !fir.heap<!fir.array<3x3x!fir.char<1,10>>
147147// CHECK-LABEL: define ptr @allocmem_array_of_dynchar(
148148// CHECK-SAME: i32 %[[len:.*]])
149149// CHECK: %[[mul1:.*]] = sext i32 %[[len]] to i64
150- // CHECK: %[[mul2:.*]] = mul i64 mul (i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64), i64 9) , %[[mul1]]
150+ // CHECK: %[[mul2:.*]] = mul i64 9 , %[[mul1]]
151151// CHECK: call ptr @malloc(i64 %[[mul2]])
152152func.func @allocmem_array_of_dynchar(%l: i32) -> !fir.heap<!fir.array<3x3x!fir.char<1,?>>> {
153153 %1 = fir.allocmem !fir.array<3x3x!fir.char<1,?>>(%l : i32)
@@ -175,7 +175,7 @@ func.func @alloca_dynarray_of_nonchar2(%e: index) -> !fir.ref<!fir.array<?x?xi32
175175
176176// CHECK-LABEL: define ptr @allocmem_dynarray_of_nonchar(
177177// CHECK-SAME: i64 %[[extent:.*]])
178- // CHECK: %[[prod1:.*]] = mul i64 ptrtoint (ptr getelementptr ([3 x i32], ptr null, i32 1) to i64) , %[[extent]]
178+ // CHECK: %[[prod1:.*]] = mul i64 12 , %[[extent]]
179179// CHECK: call ptr @malloc(i64 %[[prod1]])
180180func.func @allocmem_dynarray_of_nonchar(%e: index) -> !fir.heap<!fir.array<3x?xi32>> {
181181 %1 = fir.allocmem !fir.array<3x?xi32>, %e
@@ -184,7 +184,7 @@ func.func @allocmem_dynarray_of_nonchar(%e: index) -> !fir.heap<!fir.array<3x?xi
184184
185185// CHECK-LABEL: define ptr @allocmem_dynarray_of_nonchar2(
186186// CHECK-SAME: i64 %[[extent:.*]])
187- // CHECK: %[[prod1:.*]] = mul i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64) , %[[extent]]
187+ // CHECK: %[[prod1:.*]] = mul i64 4 , %[[extent]]
188188// CHECK: %[[prod2:.*]] = mul i64 %[[prod1]], %[[extent]]
189189// CHECK: call ptr @malloc(i64 %[[prod2]])
190190func.func @allocmem_dynarray_of_nonchar2(%e: index) -> !fir.heap<!fir.array<?x?xi32>> {
@@ -213,7 +213,7 @@ func.func @alloca_dynarray_of_char2(%e : index) -> !fir.ref<!fir.array<?x?x!fir.
213213
214214// CHECK-LABEL: define ptr @allocmem_dynarray_of_char(
215215// CHECK-SAME: i64 %[[extent:.*]])
216- // CHECK: %[[prod1:.*]] = mul i64 ptrtoint (ptr getelementptr ([3 x [10 x i16]], ptr null, i32 1) to i64) , %[[extent]]
216+ // CHECK: %[[prod1:.*]] = mul i64 60 , %[[extent]]
217217// CHECK: call ptr @malloc(i64 %[[prod1]])
218218func.func @allocmem_dynarray_of_char(%e : index) -> !fir.heap<!fir.array<3x?x!fir.char<2,10>>> {
219219 %1 = fir.allocmem !fir.array<3x?x!fir.char<2,10>>, %e
@@ -222,7 +222,7 @@ func.func @allocmem_dynarray_of_char(%e : index) -> !fir.heap<!fir.array<3x?x!fi
222222
223223// CHECK-LABEL: define ptr @allocmem_dynarray_of_char2(
224224// CHECK-SAME: i64 %[[extent:.*]])
225- // CHECK: %[[prod1:.*]] = mul i64 ptrtoint (ptr getelementptr ([10 x i16], ptr null, i32 1) to i64) , %[[extent]]
225+ // CHECK: %[[prod1:.*]] = mul i64 20 , %[[extent]]
226226// CHECK: %[[prod2:.*]] = mul i64 %[[prod1]], %[[extent]]
227227// CHECK: call ptr @malloc(i64 %[[prod2]])
228228func.func @allocmem_dynarray_of_char2(%e : index) -> !fir.heap<!fir.array<?x?x!fir.char<2,10>>> {
@@ -255,7 +255,7 @@ func.func @alloca_dynarray_of_dynchar2(%l: i32, %e : index) -> !fir.ref<!fir.arr
255255// CHECK-LABEL: define ptr @allocmem_dynarray_of_dynchar(
256256// CHECK-SAME: i32 %[[len:.*]], i64 %[[extent:.*]])
257257// CHECK: %[[prod1:.*]] = sext i32 %[[len]] to i64
258- // CHECK: %[[prod2:.*]] = mul i64 mul (i64 ptrtoint (ptr getelementptr (i16, ptr null, i32 1) to i64), i64 3) , %[[prod1]]
258+ // CHECK: %[[prod2:.*]] = mul i64 6 , %[[prod1]]
259259// CHECK: %[[prod3:.*]] = mul i64 %[[prod2]], %[[extent]]
260260// CHECK: call ptr @malloc(i64 %[[prod3]])
261261func.func @allocmem_dynarray_of_dynchar(%l: i32, %e : index) -> !fir.heap<!fir.array<3x?x!fir.char<2,?>>> {
@@ -266,7 +266,7 @@ func.func @allocmem_dynarray_of_dynchar(%l: i32, %e : index) -> !fir.heap<!fir.a
266266// CHECK-LABEL: define ptr @allocmem_dynarray_of_dynchar2(
267267// CHECK-SAME: i32 %[[len:.*]], i64 %[[extent:.*]])
268268// CHECK: %[[a:.*]] = sext i32 %[[len]] to i64
269- // CHECK: %[[prod1:.*]] = mul i64 ptrtoint (ptr getelementptr (i16, ptr null, i32 1) to i64) , %[[a]]
269+ // CHECK: %[[prod1:.*]] = mul i64 2 , %[[a]]
270270// CHECK: %[[prod2:.*]] = mul i64 %[[prod1]], %[[extent]]
271271// CHECK: %[[prod3:.*]] = mul i64 %[[prod2]], %[[extent]]
272272// CHECK: call ptr @malloc(i64 %[[prod3]])
@@ -306,7 +306,7 @@ func.func @alloca_array_with_holes_dynchar(%arg0: index, %arg1: index) -> !fir.r
306306
307307// CHECK-LABEL: define ptr @allocmem_array_with_holes_nonchar(
308308// CHECK-SAME: i64 %[[e1:.*]], i64 %[[e2:.*]])
309- // CHECK: %[[a:.*]] = mul i64 mul (i64 ptrtoint{{.*}} 15) , %[[e1]]
309+ // CHECK: %[[a:.*]] = mul i64 240 , %[[e1]]
310310// CHECK: %[[b:.*]] = mul i64 %3, %[[e2]]
311311// CHECK: call ptr @malloc(i64 %[[b]])
312312func.func @allocmem_array_with_holes_nonchar(%0 : index, %1 : index) -> !fir.heap<!fir.array<4x?x3x?x5xi32>> {
@@ -316,7 +316,7 @@ func.func @allocmem_array_with_holes_nonchar(%0 : index, %1 : index) -> !fir.hea
316316
317317// CHECK-LABEL: define ptr @allocmem_array_with_holes_char(
318318// CHECK-SAME: i64 %[[e:.*]])
319- // CHECK: %[[mul:.*]] = mul i64 mul (i64 ptrtoint (ptr getelementptr ([3 x [10 x i16]], ptr null, i32 1) to i64), i64 4) , %[[e]]
319+ // CHECK: %[[mul:.*]] = mul i64 240 , %[[e]]
320320// CHECK: call ptr @malloc(i64 %[[mul]])
321321func.func @allocmem_array_with_holes_char(%e: index) -> !fir.heap<!fir.array<3x?x4x!fir.char<2,10>>> {
322322 %1 = fir.allocmem !fir.array<3x?x4x!fir.char<2,10>>, %e
@@ -325,7 +325,7 @@ func.func @allocmem_array_with_holes_char(%e: index) -> !fir.heap<!fir.array<3x?
325325
326326// CHECK-LABEL: define ptr @allocmem_array_with_holes_dynchar(
327327// CHECK-SAME: i64 %[[len:.*]], i64 %[[extent:.*]])
328- // CHECK: %[[a:.*]] = mul i64 mul (i64 ptrtoint (ptr getelementptr (i16, ptr null, i32 1) to i64), i64 12) , %[[len]]
328+ // CHECK: %[[a:.*]] = mul i64 24 , %[[len]]
329329// CHECK: %[[b:.*]] = mul i64 %[[a]], %[[extent]]
330330// CHECK: call ptr @malloc(i64 %[[b]])
331331func.func @allocmem_array_with_holes_dynchar(%arg0: index, %arg1: index) -> !fir.heap<!fir.array<3x?x4x!fir.char<2,?>>> {
0 commit comments