Nikita Popov
90ba33099c
[InstCombine] Canonicalize constant GEPs to i8 source element type ( #68882 )
...
This patch canonicalizes getelementptr instructions with constant
indices to use the `i8` source element type. This makes it easier for
optimizations to recognize that two GEPs are identical, because they
don't need to see past many different ways to express the same offset.
This is a first step towards
https://discourse.llvm.org/t/rfc-replacing-getelementptr-with-ptradd/68699 .
This is limited to constant GEPs only for now, as they have a clear
canonical form, while we're not yet sure how exactly to deal with
variable indices.
The test llvm/test/Transforms/PhaseOrdering/switch_with_geps.ll gives
two representative examples of the kind of optimization improvement we
expect from this change. In the first test SimplifyCFG can now realize
that all switch branches are actually the same. In the second test it
can convert it into simple arithmetic. These are representative of
common optimization failures we see in Rust.
Fixes https://github.com/llvm/llvm-project/issues/69841 .
2024-01-24 15:25:29 +01:00
..
2022-02-24 15:30:13 -05:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-12-12 20:36:35 +01:00
2023-08-28 12:13:42 -04:00
2023-10-24 14:02:51 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2024-01-24 15:25:29 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2020-07-05 11:50:38 -07:00
2022-12-12 17:11:46 +01:00
2023-06-06 17:02:35 +02:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-06-06 17:02:35 +02:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-02-17 09:49:03 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2024-01-11 09:46:54 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-06-17 17:28:00 -07:00
2020-12-31 00:27:11 -08:00
2023-08-28 12:13:42 -04:00
2022-09-02 12:36:44 -07:00
2022-12-12 17:11:46 +01:00
2021-03-23 15:26:25 +01:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2022-02-16 16:10:37 -05:00
2020-09-02 12:19:11 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2022-02-16 16:10:37 -05:00
2022-02-16 16:10:37 -05:00
2022-09-02 12:36:44 -07:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2023-06-06 17:02:35 +02:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-06-06 17:02:35 +02:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2022-02-16 16:10:37 -05:00
2021-11-12 16:21:21 -08:00
2023-08-28 12:13:42 -04:00
2023-02-16 15:48:10 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2023-11-06 11:10:59 -08:00
2021-11-22 14:02:54 -06:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2023-06-12 18:38:47 +02:00
2020-03-31 22:33:55 -07:00
2020-03-31 22:33:55 -07:00
2020-03-31 22:33:55 -07:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2019-12-17 09:40:36 +01:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2022-12-21 04:00:40 -05:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2020-03-31 22:33:55 -07:00
2020-03-31 22:33:55 -07:00
2020-03-31 22:33:55 -07:00
2023-08-28 12:13:42 -04:00
2021-03-30 11:07:16 +02:00
2020-03-31 22:33:55 -07:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2019-11-08 08:23:22 -08:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2024-01-11 09:46:54 +01:00
2020-01-23 22:39:47 -08:00
2022-12-12 17:11:46 +01:00
2023-06-06 17:02:35 +02:00
2024-01-12 09:03:37 +00:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2022-02-16 16:10:37 -05:00
2022-02-16 16:10:37 -05:00
2022-12-12 17:11:46 +01:00
2024-01-12 09:03:37 +00:00
2022-01-28 08:38:01 -05:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2024-01-10 16:52:13 +00:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-06-06 17:02:35 +02:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-06-06 17:02:35 +02:00
2023-06-06 17:02:35 +02:00
2023-06-06 17:02:35 +02:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2024-01-22 08:38:41 +00:00
2022-12-12 17:11:46 +01:00
2022-07-24 13:59:45 +01:00
2022-12-12 17:11:46 +01:00
2022-09-02 12:36:44 -07:00
2023-08-28 12:13:42 -04:00
2020-03-11 13:26:06 -07:00
2022-12-12 17:11:46 +01:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2022-02-24 15:30:13 -05:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2023-05-23 08:29:52 +02:00
2023-08-28 12:13:42 -04:00
2023-06-06 17:02:35 +02:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2024-01-03 17:34:00 +00:00
2022-09-02 12:36:44 -07:00
2023-06-06 17:02:35 +02:00
2022-02-16 16:10:37 -05:00
2020-12-30 20:52:01 -08:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2023-06-07 15:52:44 +02:00
2021-11-12 16:21:21 -08:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2024-01-11 09:46:54 +01:00
2023-01-05 19:48:25 -08:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2022-12-12 17:11:46 +01:00
2023-06-07 15:52:44 +02:00
2023-06-07 15:52:44 +02:00
2023-06-07 15:52:44 +02:00
2023-06-07 15:52:44 +02:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2023-06-07 15:52:44 +02:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2022-12-12 17:11:46 +01:00
2022-02-16 16:10:37 -05:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-02-16 16:10:37 -05:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2023-06-07 15:52:44 +02:00
2023-01-24 16:28:01 -08:00
2023-09-26 08:30:31 -07:00
2022-02-16 16:10:37 -05:00
2023-06-07 15:52:44 +02:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2022-02-16 16:10:37 -05:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2024-01-11 09:46:54 +01:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2022-02-16 16:10:37 -05:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-06-07 15:52:44 +02:00
2022-12-12 17:11:46 +01:00
2024-01-10 16:52:13 +00:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2022-04-20 11:30:12 -04:00
2020-03-31 22:33:55 -07:00
2022-02-16 16:10:37 -05:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2021-07-15 15:05:08 +01:00
2022-12-12 17:11:46 +01:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2022-04-11 12:08:29 +02:00
2020-03-09 15:40:24 -07:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2024-01-11 09:46:54 +01:00
2024-01-11 09:46:54 +01:00
2023-06-07 15:52:44 +02:00
2023-08-28 12:13:42 -04:00
2023-06-07 15:52:44 +02:00
2022-02-16 16:10:37 -05:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-07-18 12:45:52 +02:00
2022-12-12 17:11:46 +01:00
2022-12-12 17:11:46 +01:00
2023-06-07 15:52:44 +02:00
2022-12-12 17:11:46 +01:00
2023-06-07 15:52:44 +02:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-12-12 17:11:46 +01:00
2024-01-11 09:46:54 +01:00
2023-08-28 12:13:42 -04:00
2024-01-11 09:46:54 +01:00