Slava Zakharin
2e637dbbb8
[flang] Canonicalize redundant pointer converts. ( #121864 )
...
This patch adds a canonicalization pattern for optimizing redundant
"pointer" fir.converts. Such converts prevent the StackArrays pass
to recognize fir.freemem for the corresponding fir.allocmem, e.g.:
```
%69 = fir.allocmem !fir.array<2xi32>
%71:2 = hlfir.declare %69(%70) {uniq_name = ".tmp.arrayctor"} :
(!fir.heap<!fir.array<2xi32>>, !fir.shape<1>) ->
(!fir.heap<!fir.array<2xi32>>, !fir.heap<!fir.array<2xi32>>)
%95 = fir.convert %71#1 :
(!fir.heap<!fir.array<2xi32>>) -> !fir.ref<!fir.array<2xi32>>
%100 = fir.convert %95 :
(!fir.ref<!fir.array<2xi32>>) -> !fir.heap<!fir.array<2xi32>>
fir.freemem %100 : !fir.heap<!fir.array<2xi32>>
```
I found this in `tonto`, but the change does not affect performance at all.
Anyway, it looks like a reasonable thing to do, and it makes easier
to compare the performance profiles with other compilers'.
2025-01-07 08:35:43 -08:00
..
2025-01-02 17:02:59 -08:00
2024-10-21 09:49:58 -07:00
2023-01-31 20:11:35 +01:00
2024-04-22 10:11:09 +01:00
2024-10-14 09:35:29 +02:00
2024-07-24 10:24:04 +02:00
2022-06-10 10:58:54 +00:00
2022-11-04 18:15:03 -07:00
2024-06-14 11:36:05 -05:00
2024-01-18 09:37:44 +01:00
2024-06-04 15:21:19 -07:00
2023-12-08 10:51:20 +00:00
2024-10-03 17:10:57 +02:00
2023-01-23 12:33:37 -08:00
2024-04-24 10:29:53 +01:00
2023-01-23 12:33:37 -08:00
2023-11-08 15:04:00 -05:00
2023-10-06 09:29:57 +02:00
2022-06-30 10:36:18 +02:00
2024-11-28 15:39:26 +09:00
2024-11-28 15:39:26 +09:00
2025-01-07 08:22:20 -08:00
2024-11-28 15:39:26 +09:00
2023-11-29 10:27:27 +01:00
2024-08-06 18:23:05 -04:00
2024-11-28 15:39:26 +09:00
2022-12-07 11:59:10 +01:00
2024-12-09 17:27:18 +00:00
2024-12-09 17:27:18 +00:00
2024-11-28 15:39:26 +09:00
2022-11-03 11:36:12 -04:00
2022-06-22 09:39:11 +02:00
2024-10-31 18:59:04 -07:00
2023-09-19 15:00:04 +01:00
2024-11-28 15:39:26 +09:00
2024-10-03 17:10:57 +02:00
2024-10-04 09:57:03 +02:00
2025-01-07 08:35:43 -08:00
2023-10-06 09:29:57 +02:00
2024-12-10 16:26:53 +09:00
2023-10-25 09:42:28 +02:00
2024-11-13 17:09:38 -08:00
2024-08-21 13:37:03 -07:00
2024-10-03 17:10:57 +02:00
2022-06-21 20:43:22 +02:00
2024-11-28 15:39:26 +09:00
2024-10-18 21:30:38 -07:00
2024-05-17 09:37:53 -07:00
2024-07-22 12:51:30 +02:00
2022-10-19 11:06:58 +02:00
2024-10-03 17:10:03 +02:00
2024-04-30 17:40:36 -07:00
2024-05-16 09:10:59 +01:00
2024-10-30 09:50:27 -07:00
2023-10-25 09:42:28 +02:00
2022-06-17 16:10:12 +02:00
2024-11-28 15:39:26 +09:00
2024-01-18 15:33:43 +00:00
2024-11-28 15:39:26 +09:00
2022-11-09 15:31:09 -08:00
2022-06-22 15:35:04 +02:00
2024-10-03 17:10:57 +02:00
2024-10-04 09:57:03 +02:00
2023-04-20 07:06:05 -05:00
2023-03-28 10:11:47 -07:00
2022-06-10 10:58:54 +00:00
2024-11-28 15:39:26 +09:00
2022-11-03 18:53:23 +00:00
2024-10-04 09:57:03 +02:00
2024-10-09 10:37:46 -03:00
2024-06-03 17:14:03 +02:00
2023-03-28 10:11:47 -07:00
2024-12-10 16:26:53 +09:00
2024-12-10 16:26:53 +09:00
2024-06-06 11:16:40 -07:00
2022-08-01 17:22:55 +02:00
2024-07-17 09:15:47 +02:00
2024-03-05 09:23:13 +01:00
2024-04-22 10:11:09 +01:00
2023-10-25 09:42:28 +02:00
2024-05-16 15:27:59 +01:00
2024-10-17 13:25:09 +02:00
2022-06-22 15:35:04 +02:00
2022-06-10 10:58:54 +00:00
2024-11-28 15:39:26 +09:00
2022-06-22 15:35:04 +02:00
2024-06-13 10:43:58 +02:00
2024-08-01 09:39:53 -07:00
2023-10-25 09:42:28 +02:00
2024-10-03 17:10:57 +02:00
2023-12-12 11:52:39 +01:00
2023-10-25 09:42:28 +02:00
2022-10-21 09:09:25 +00:00
2022-06-10 10:58:54 +00:00
2022-07-25 19:38:59 +02:00
2024-12-18 07:43:22 +00:00
2024-11-29 11:50:28 +08:00
2024-11-29 11:50:28 +08:00
2024-11-28 15:39:26 +09:00
2024-09-10 14:33:12 +02:00
2024-09-10 14:33:12 +02:00
2024-11-25 14:36:53 +00:00
2024-11-29 11:50:28 +08:00
2024-10-14 09:35:29 +02:00
2024-10-03 17:10:57 +02:00
2024-10-03 17:10:57 +02:00
2024-12-02 14:45:14 +01:00
2024-11-13 16:13:37 +08:00
2024-11-28 15:39:26 +09:00
2024-10-03 17:10:57 +02:00
2024-11-19 19:58:20 +08:00
2023-11-08 15:04:00 -05:00
2023-12-20 10:15:09 +01:00
2024-10-03 17:10:57 +02:00
2024-01-30 13:45:56 +00:00
2024-01-30 13:45:56 +00:00
2024-12-02 14:45:14 +01:00
2024-08-14 11:23:56 -07:00
2023-12-28 15:41:27 +00:00
2024-10-30 09:50:27 -07:00
2024-10-31 19:18:24 +00:00
2024-10-31 19:18:24 +00:00
2024-08-21 13:37:03 -07:00
2024-10-04 09:57:03 +02:00
2024-10-03 17:10:57 +02:00
2024-06-14 14:10:41 +01:00
2024-06-14 14:10:41 +01:00
2022-06-10 10:58:54 +00:00