Alexander Richardson
3a4b351ba1
[IR] Introduce the ptrtoaddr
instruction
...
This introduces a new `ptrtoaddr` instruction which is similar to
`ptrtoint` but has two differences:
1) Unlike `ptrtoint`, `ptrtoaddr` does not capture provenance
2) `ptrtoaddr` only extracts (and then extends/truncates) the low
index-width bits of the pointer
For most architectures, difference 2) does not matter since index (address)
width and pointer representation width are the same, but this does make a
difference for architectures that have pointers that aren't just plain
integer addresses such as AMDGPU fat pointers or CHERI capabilities.
This commit introduces textual and bitcode IR support as well as basic code
generation, but optimization passes do not handle the new instruction yet
so it may result in worse code than using ptrtoint. Follow-up changes will
update capture tracking, etc. for the new instruction.
RFC: https://discourse.llvm.org/t/clarifiying-the-semantics-of-ptrtoint/83987/54
Reviewed By: nikic
Pull Request: https://github.com/llvm/llvm-project/pull/139357
2025-08-08 10:12:39 -07:00
..
2022-12-01 21:25:59 +01:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2022-12-13 14:36:21 +01:00
2018-02-27 11:15:05 +00:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2022-12-13 14:36:21 +01:00
2014-08-19 21:08:27 +00:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2014-08-19 21:08:27 +00:00
2025-04-30 15:01:00 +02:00
2014-11-06 15:05:51 +00:00
2014-08-19 21:08:27 +00:00
2025-04-30 15:01:00 +02:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2025-04-30 15:01:00 +02:00
2024-06-04 08:31:03 +02:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2021-08-05 21:55:23 -07:00
2025-05-01 13:45:20 +02:00
2025-05-01 13:45:20 +02:00
2022-12-13 14:36:21 +01:00
2025-04-09 18:00:28 +01:00
2025-07-01 15:56:02 +02:00
2023-06-30 12:31:32 -04:00
2022-12-13 14:36:21 +01:00
2024-12-12 22:44:10 +01:00
2021-10-06 13:29:23 -07:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2014-08-19 21:08:27 +00:00
2020-05-16 14:53:16 -07:00
2020-05-16 14:53:16 -07:00
2017-04-10 22:27:50 +00:00
2015-03-13 19:30:44 +00:00
2024-10-07 14:02:28 -07:00
2022-05-31 10:01:17 -04:00
2025-04-25 10:19:47 +02:00
2025-05-14 12:34:27 +09:00
2023-06-22 10:02:45 +02:00
2024-01-04 10:38:18 +01:00
2022-12-13 14:36:21 +01:00
2023-01-25 22:38:53 -04:00
2025-04-30 22:06:37 +01:00
2024-11-07 08:11:15 +00:00
2022-12-13 14:36:21 +01:00
2025-08-08 11:09:34 +02:00
2025-07-24 14:32:59 -07:00
2025-04-17 11:11:00 +02:00
2025-08-08 11:09:34 +02:00
2025-05-14 21:51:56 +01:00
2020-06-05 17:22:43 -07:00
2020-05-16 14:53:16 -07:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2021-07-15 17:51:11 +02:00
2021-07-15 17:51:11 +02:00
2022-12-13 14:36:21 +01:00
2024-11-05 13:28:22 -08:00
2022-12-13 14:36:21 +01:00
2022-10-11 09:53:08 +02:00
2024-01-19 14:55:31 +01:00
2025-07-18 14:40:54 -07:00
2025-01-13 14:40:25 +01:00
2025-01-13 14:40:25 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-06-02 09:40:56 +02:00
2023-12-08 18:41:30 +00:00
2024-11-21 11:21:12 +00:00
2025-02-14 09:28:57 +01:00
2023-03-16 10:32:08 +01:00
2024-06-03 15:00:25 +02:00
2025-05-02 08:17:58 +00:00
2020-05-16 14:53:16 -07:00
2021-12-07 23:20:17 -08:00
2018-02-19 09:56:22 +00:00
2020-03-12 16:32:05 -07:00
2024-03-07 13:05:04 +00:00
2024-03-07 13:05:04 +00:00
2024-03-07 13:05:04 +00:00
2024-03-07 13:05:04 +00:00
2024-03-07 13:05:04 +00:00
2024-03-07 13:05:04 +00:00
2024-03-07 13:05:04 +00:00
2024-03-07 13:05:04 +00:00
2024-03-07 13:05:04 +00:00
2024-11-13 09:55:37 -08:00
2024-06-14 15:07:27 +01:00
2019-04-08 19:13:55 +00:00
2020-04-20 17:29:04 -07:00
2025-04-09 18:00:28 +01:00
2019-01-08 17:52:29 +00:00
2020-04-18 12:49:31 -07:00
2025-07-21 18:42:21 -04:00
2018-10-03 18:44:53 +00:00
2017-08-23 20:31:27 +00:00
2017-07-19 00:09:54 +00:00
2016-04-15 15:57:41 +00:00
2016-12-22 00:29:00 +00:00
2020-12-18 13:10:57 -05:00
2015-06-02 17:13:25 +00:00
2015-01-08 22:38:29 +00:00
2022-12-13 14:36:21 +01:00
2020-09-25 10:26:35 -07:00
2020-05-28 13:46:41 +05:30
2015-06-02 17:13:25 +00:00
2025-06-11 13:56:30 +01:00
2022-12-13 14:36:21 +01:00
2022-09-23 18:32:07 +00:00
2019-08-23 17:19:21 +00:00
2014-08-19 21:08:27 +00:00
2012-07-02 18:37:59 +00:00
2015-02-16 09:18:13 +00:00
2024-12-04 10:53:04 +00:00
2025-02-14 09:28:57 +01:00
2024-10-16 11:43:17 -07:00
2015-04-29 16:38:44 +00:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2024-05-30 08:36:44 +02:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2024-05-30 08:36:44 +02:00
2022-12-13 14:36:21 +01:00
2023-12-05 09:42:53 +08:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2014-08-19 21:08:27 +00:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2022-11-22 21:42:44 -05:00
2025-05-23 15:45:59 +05:30
2024-04-19 09:04:02 +09:00
2024-04-19 09:04:02 +09:00
2024-04-19 09:04:02 +09:00
2024-04-19 09:04:02 +09:00
2022-12-13 14:36:21 +01:00
2014-12-15 19:07:53 +00:00
2024-02-05 10:12:54 +01:00
2024-01-19 16:08:16 +01:00
2024-01-19 16:08:16 +01:00
2023-12-05 11:00:13 +01:00
2024-06-21 12:09:00 -07:00
2022-07-15 10:18:17 +02:00
2024-03-20 10:59:45 +01:00
2022-07-04 09:27:22 +02:00
2012-07-02 18:37:59 +00:00
2014-05-07 22:57:20 +00:00
2014-05-07 22:57:20 +00:00
2014-05-07 22:57:20 +00:00
2012-07-02 18:37:59 +00:00
2022-12-13 14:36:21 +01:00
2012-07-02 18:37:59 +00:00
2022-12-09 09:53:42 +00:00
2024-04-06 15:27:45 -04:00
2024-04-06 15:27:45 -04:00
2024-11-05 13:28:22 -08:00
2024-11-05 13:28:22 -08:00
2024-11-05 13:28:22 -08:00
2024-11-05 13:28:22 -08:00
2015-01-06 22:55:16 +00:00
2024-08-20 11:25:49 +03:00
2015-02-16 06:04:53 +00:00
2015-08-03 17:26:41 +00:00
2015-08-03 17:26:41 +00:00
2015-08-03 17:26:41 +00:00
2015-08-03 17:26:41 +00:00
2015-06-02 17:13:25 +00:00
2015-06-02 17:13:25 +00:00
2022-02-22 17:50:13 -08:00
2015-06-02 17:13:25 +00:00
2015-06-02 17:13:25 +00:00
2015-06-02 17:13:25 +00:00
2015-07-31 18:58:39 +00:00
2015-06-02 17:13:25 +00:00
2015-06-02 17:13:25 +00:00
2015-06-02 17:13:25 +00:00
2015-06-02 17:13:25 +00:00
2015-06-02 17:13:25 +00:00
2015-06-02 17:13:25 +00:00
2015-06-02 17:13:25 +00:00
2018-01-24 09:56:07 +00:00
2015-06-02 17:13:25 +00:00
2015-06-02 17:13:25 +00:00
2015-08-31 21:36:14 +00:00
2016-05-10 18:22:45 +00:00
2021-07-15 17:51:11 +02:00
2025-05-23 15:45:59 +05:30
2025-05-23 15:45:59 +05:30
2025-05-23 15:45:59 +05:30
2022-07-12 11:41:16 +02:00
2024-10-29 12:26:33 -07:00
2025-04-30 09:11:36 +02:00
2025-04-30 09:11:36 +02:00
2024-10-07 14:02:28 -07:00
2016-04-06 02:06:40 +00:00
2014-12-15 19:07:53 +00:00
2014-12-11 01:34:46 +00:00
2014-12-15 19:07:53 +00:00
2014-12-15 19:07:53 +00:00
2024-10-29 12:26:33 -07:00
2024-10-29 12:26:33 -07:00
2023-07-12 14:35:55 +02:00
2023-07-12 14:35:55 +02:00
2024-05-28 16:39:09 -07:00
2024-05-28 16:39:09 -07:00
2024-05-28 16:39:09 -07:00
2024-05-28 16:39:09 -07:00
2024-05-28 16:39:09 -07:00
2021-07-15 17:51:11 +02:00
2022-06-02 09:40:56 +02:00
2015-01-14 18:25:45 +00:00
2022-12-13 14:36:21 +01:00
2024-08-20 13:24:15 -05:00
2025-01-29 16:56:47 +01:00
2025-02-13 12:13:39 +01:00
2025-02-13 12:13:39 +01:00
2016-06-21 23:42:48 +00:00
2022-12-13 14:36:21 +01:00
2015-04-29 16:38:44 +00:00
2025-04-09 18:00:28 +01:00
2016-06-21 23:42:48 +00:00
2019-11-14 10:40:41 -08:00
2021-07-15 17:51:11 +02:00
2021-07-15 17:51:11 +02:00
2022-12-13 14:36:21 +01:00
2022-12-13 14:36:21 +01:00
2024-11-05 09:41:10 +00:00
2023-12-08 16:28:23 +01:00
2024-10-07 23:21:42 +04:00
2024-05-28 16:09:53 +02:00
2023-03-06 15:43:34 -08:00
2022-12-13 14:36:21 +01:00
2023-07-12 14:35:55 +02:00
2023-07-12 14:35:55 +02:00
2023-07-12 14:35:55 +02:00
2024-11-06 11:53:33 +00:00
2024-12-13 20:10:06 +08:00
2014-05-07 22:57:20 +00:00
2022-12-13 14:36:21 +01:00
2014-05-07 22:57:20 +00:00
2024-05-28 16:39:09 -07:00
2025-08-08 10:12:39 -07:00
2025-08-08 10:12:39 -07:00
2025-08-08 10:12:39 -07:00
2024-08-08 18:07:09 +02:00
2024-03-09 19:47:43 +08:00
2022-12-13 14:36:21 +01:00
2025-03-03 12:39:35 +08:00
2023-05-19 09:39:36 -07:00
2014-08-19 21:08:27 +00:00
2014-12-09 19:10:03 +00:00
2024-01-31 17:04:30 +01:00
2024-01-31 17:04:30 +01:00
2024-01-19 14:55:31 +01:00
2019-10-10 18:31:57 +00:00
2016-03-30 18:15:08 +00:00
2022-12-13 14:36:21 +01:00
2023-12-08 17:18:20 +01:00
2023-12-07 17:00:44 +01:00
2024-11-06 10:37:22 -08:00
2024-11-22 10:02:43 +00:00
2018-06-26 13:56:49 +00:00
2018-06-26 13:56:49 +00:00
2025-05-09 16:28:49 -07:00
2024-04-10 19:46:01 -07:00
2024-04-10 19:46:01 -07:00
2024-08-27 13:53:25 -04:00
2023-11-30 16:59:13 -08:00
2024-04-10 19:46:01 -07:00
2015-11-11 21:57:16 +00:00
2022-12-13 14:36:21 +01:00
2015-01-06 22:55:16 +00:00
2022-12-13 14:36:21 +01:00
2024-11-05 09:41:10 +00:00
2022-07-04 09:27:22 +02:00
2022-02-14 14:35:02 +00:00
2022-02-14 14:35:02 +00:00
2014-08-19 21:08:27 +00:00
2023-11-14 09:25:14 +01:00
2022-12-13 14:36:21 +01:00
2022-08-31 14:24:12 +02:00