Alex Bradbury
52b345d036
[RISCV][TII] Add and use new hook to simplify/canonicalize instructions after MachineCopyPropagation ( #137973 )
...
PR #136875 was posted as a draft PR that handled a subset of these
cases, using the CompressPat mechanism. The consensus from that
discussion (and a conclusion I agree with) is that it would be
beneficial doing this optimisation earlier on, and in a way that isn't
limited just to cases that can be handled by instruction compression.
The most common source for instructions that can be
optimized/canonicalized in this way is through tail duplication in
MachineBlockPlacement followed by machine copy propagation. For RISC-V,
choosing a more canonical instruction allows it to be compressed when it
couldn't be before. There is the potential that it would make other
MI-level optimisations easier.
This modifies ~910 instructions across an llvm-test-suite build
including SPEC2017, targeting rva22u64. Looking at the diff, it seems
there's room for eliminating instructions or further propagating after
this.
Coverage of instructions is based on observations from a script written
to find redundant or improperly canonicalized instructions (though I aim
to support all instructions in a 'group' at once, e.g. MUL* even if I
only saw some variants of MUL in practice).
2025-05-08 12:33:14 +01:00
..
2025-04-30 22:06:37 +01:00
2025-05-07 15:51:19 -07:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2025-03-28 19:23:56 +00:00
2025-01-07 13:33:22 -03:00
2025-01-06 19:23:21 +08:00
2025-04-08 19:42:43 -07:00
2025-04-28 10:14:12 +02:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2024-11-06 00:20:21 +03:00
2024-11-25 18:59:31 -08:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2024-11-15 17:53:14 +08:00
2025-02-13 09:57:33 -08:00
2024-12-12 07:58:36 +01:00
2024-11-15 17:53:14 +08:00
2025-03-28 19:23:56 +00:00
2025-03-28 19:23:56 +00:00
2024-07-09 10:45:56 -07:00
2024-12-17 00:19:45 -08:00
2025-04-28 08:35:51 -07:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2025-03-28 19:23:56 +00:00
2025-03-28 19:23:56 +00:00
2025-03-28 19:23:56 +00:00
2024-06-21 11:11:10 +08:00
2025-04-28 17:23:51 +08:00
2024-11-15 17:53:14 +08:00
2025-03-28 19:23:56 +00:00
2024-11-15 17:53:14 +08:00
2025-03-28 19:23:56 +00:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2025-03-27 19:31:38 -03:00
2025-03-07 09:23:50 +08:00
2024-11-15 17:53:14 +08:00
2024-07-09 14:34:03 +08:00
2024-07-09 14:34:03 +08:00
2024-07-09 14:34:03 +08:00
2025-02-13 09:57:33 -08:00
2024-09-03 16:04:51 -07:00
2024-09-03 16:04:51 -07:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2025-02-13 09:57:33 -08:00
2025-03-27 19:31:38 -03:00
2025-02-13 09:57:33 -08:00
2024-11-12 09:35:16 -08:00
2024-11-12 09:35:16 -08:00
2024-11-15 17:53:14 +08:00
2025-03-06 13:02:17 +08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-04-23 17:36:00 -07:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2024-10-11 20:25:53 +01:00
2025-02-13 09:57:33 -08:00
2024-06-20 07:27:07 +02:00
2024-11-15 17:53:14 +08:00
2025-02-13 09:57:33 -08:00
2025-04-08 19:34:03 -07:00
2024-11-15 17:53:14 +08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2024-11-28 15:01:49 +08:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2025-04-29 22:33:40 +03:00
2025-04-24 10:13:05 +03:00
2025-01-28 21:03:12 +05:30
2025-04-22 17:14:25 +01:00
2025-03-28 19:23:56 +00:00
2024-11-15 17:53:14 +08:00
2025-03-28 19:23:56 +00:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2025-03-27 19:31:38 -03:00
2025-02-13 09:57:33 -08:00
2024-10-11 20:25:53 +01:00
2025-03-28 19:23:56 +00:00
2025-02-13 09:57:33 -08:00
2025-03-27 07:45:42 -07:00
2024-11-27 10:24:34 -08:00
2025-03-06 13:01:58 +08:00
2025-03-17 16:39:51 +08:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2025-02-13 09:57:33 -08:00
2024-11-06 00:20:21 +03:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2024-12-04 13:52:20 -08:00
2025-04-08 10:11:20 -07:00
2025-03-28 07:06:17 -07:00
2024-11-06 00:20:21 +03:00
2025-04-14 14:48:47 +08:00
2024-11-06 00:20:21 +03:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2024-10-11 20:25:53 +01:00
2025-02-13 09:57:33 -08:00
2025-04-28 17:23:51 +08:00
2024-12-06 14:07:27 -05:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2025-03-27 19:31:38 -03:00
2024-08-08 17:33:54 -07:00
2025-03-28 19:23:56 +00:00
2025-02-13 09:57:33 -08:00
2024-10-01 22:09:27 -07:00
2024-10-01 22:09:27 -07:00
2024-11-27 10:24:34 -08:00
2025-03-06 13:01:58 +08:00
2024-11-09 10:02:06 +00:00
2024-11-15 17:53:14 +08:00
2024-11-06 00:20:21 +03:00
2025-02-13 09:57:33 -08:00
2024-12-04 13:52:20 -08:00
2025-04-11 16:12:19 -07:00
2024-07-05 10:55:36 +08:00
2024-11-15 17:53:14 +08:00
2025-03-28 19:23:56 +00:00
2025-04-22 19:24:29 -07:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2024-11-06 00:20:21 +03:00
2024-10-11 20:25:53 +01:00
2025-03-27 07:45:42 -07:00
2025-04-11 15:07:51 +03:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2024-12-11 16:06:49 +00:00
2024-12-11 16:06:49 +00:00
2024-12-11 16:06:49 +00:00
2024-12-11 16:06:49 +00:00
2024-12-11 16:06:49 +00:00
2025-03-17 12:51:39 +08:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2025-03-27 19:31:38 -03:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2024-09-26 22:56:12 -07:00
2025-03-06 13:01:58 +08:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2024-11-06 00:20:21 +03:00
2025-02-13 09:57:33 -08:00
2024-09-03 16:04:51 -07:00
2024-12-04 13:52:20 -08:00
2024-10-11 20:25:53 +01:00
2025-04-08 19:34:03 -07:00
2025-02-13 09:57:33 -08:00
2025-03-25 07:59:44 -07:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-04-29 08:12:32 -07:00
2024-08-26 13:30:23 +03:00
2024-11-06 00:20:21 +03:00
2024-12-06 00:48:05 +08:00
2024-09-30 23:52:35 -07:00
2024-10-18 18:17:23 -07:00
2024-11-06 00:20:21 +03:00
2024-10-18 10:40:38 +01:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-05-06 18:01:17 -07:00
2024-11-15 17:53:14 +08:00
2025-03-26 18:25:59 -07:00
2025-03-28 19:23:56 +00:00
2025-02-04 10:02:42 -03:00
2025-01-31 14:05:34 -08:00
2025-01-31 14:05:34 -08:00
2025-01-08 16:19:31 -08:00
2025-01-28 21:03:12 +05:30
2025-04-08 19:42:43 -07:00
2024-11-15 17:53:14 +08:00
2024-11-06 00:20:21 +03:00
2025-02-13 09:57:33 -08:00
2025-01-28 21:03:12 +05:30
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-03-07 09:21:36 +01:00
2024-11-06 00:20:21 +03:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2025-03-04 11:36:16 -08:00
2024-11-15 17:53:14 +08:00
2025-03-28 19:23:56 +00:00
2025-03-10 13:22:59 +00:00
2025-05-08 12:33:14 +01:00
2025-02-21 12:53:13 +05:30
2024-11-26 23:39:45 +08:00
2024-11-26 23:39:45 +08:00
2024-11-26 23:39:45 +08:00
2024-11-26 23:39:45 +08:00
2024-11-26 23:39:45 +08:00
2024-12-19 13:00:08 +08:00
2025-03-28 19:23:56 +00:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2024-09-11 09:53:11 -07:00
2024-11-26 23:39:45 +08:00
2024-11-26 23:39:45 +08:00
2025-03-03 15:49:37 +05:30
2025-02-13 09:57:33 -08:00
2024-09-26 22:56:12 -07:00
2024-09-16 12:51:07 -07:00
2024-10-01 22:09:27 -07:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-01-13 12:06:26 +08:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2025-02-13 09:57:33 -08:00
2024-10-11 20:25:53 +01:00
2024-11-15 17:53:14 +08:00
2025-02-12 18:54:39 +05:30
2025-04-22 17:36:41 -04:00
2024-07-09 10:45:56 -07:00
2025-02-13 09:57:33 -08:00
2024-10-18 09:35:42 +04:00
2025-02-13 09:57:33 -08:00
2024-11-06 00:20:21 +03:00
2025-03-14 13:11:45 +01:00
2025-03-27 19:31:38 -03:00
2025-01-31 15:19:44 -08:00
2025-03-26 11:14:16 -07:00
2025-02-25 10:04:57 -08:00
2025-02-13 09:57:33 -08:00
2024-10-04 12:22:11 +03:00
2025-03-28 19:23:56 +00:00
2025-04-08 19:42:43 -07:00
2025-04-10 11:29:14 -04:00
2025-02-08 16:25:27 -08:00
2025-02-13 09:57:33 -08:00
2025-04-24 10:13:05 +03:00
2024-11-06 00:20:21 +03:00
2024-11-06 00:20:21 +03:00
2025-02-13 09:57:33 -08:00
2024-11-06 00:20:21 +03:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2024-11-15 17:53:14 +08:00
2025-03-26 18:25:59 -07:00
2024-12-19 21:38:20 +01:00
2024-11-06 00:20:21 +03:00
2024-07-29 17:15:02 -07:00
2025-04-24 10:13:05 +03:00
2024-10-31 16:40:29 +00:00
2024-07-03 20:32:46 +08:00
2024-09-27 13:48:01 -07:00
2025-04-23 08:54:10 +03:00
2025-04-18 09:12:52 -07:00
2024-11-06 00:20:21 +03:00
2025-03-19 11:09:49 -07:00
2025-04-23 17:36:00 -07:00
2025-03-06 13:31:08 -08:00
2025-04-28 08:12:45 -07:00
2025-02-04 10:04:19 -05:00
2025-03-31 10:02:12 -04:00
2024-10-01 13:45:30 +01:00
2025-03-18 08:25:49 -07:00
2025-03-28 07:06:17 -07:00
2025-04-08 10:11:20 -07:00
2025-03-28 19:23:56 +00:00
2024-08-27 10:08:43 +08:00
2024-11-26 12:25:54 +03:00
2024-08-15 10:37:04 +08:00
2025-04-28 10:07:51 +08:00
2025-04-28 10:07:51 +08:00
2024-08-01 12:24:25 +08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-03-07 10:52:04 +08:00
2024-12-26 21:50:35 -08:00
2025-04-29 22:33:40 +03:00
2024-11-14 13:47:49 -08:00
2025-03-19 06:06:13 +01:00
2025-04-29 22:33:40 +03:00
2025-03-28 19:23:56 +00:00
2025-02-13 09:57:33 -08:00
2024-11-06 11:36:30 -08:00
2025-02-13 09:57:33 -08:00
2024-12-02 09:06:08 -08:00
2024-12-02 09:06:08 -08:00
2024-12-02 09:06:08 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2024-11-06 00:20:21 +03:00
2024-12-11 17:41:19 +08:00
2024-11-06 00:20:21 +03:00
2024-11-06 00:20:21 +03:00
2025-02-13 09:57:33 -08:00
2024-11-05 21:48:38 -08:00
2024-11-05 21:12:09 -08:00
2024-11-05 21:48:38 -08:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2024-11-25 18:59:31 -08:00
2024-12-29 12:39:37 -08:00
2025-04-24 10:13:05 +03:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2025-03-19 06:06:13 +01:00
2025-04-24 10:13:05 +03:00
2025-03-28 19:23:56 +00:00
2024-10-04 16:03:09 +08:00
2024-08-14 15:18:10 -07:00
2024-09-03 13:33:14 -07:00
2024-09-03 13:33:14 -07:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2025-02-13 09:57:33 -08:00
2024-08-23 14:06:12 +01:00
2025-04-15 23:17:03 +02:00
2025-04-15 23:17:03 +02:00
2024-11-15 17:53:14 +08:00
2025-04-15 23:17:03 +02:00
2025-02-25 10:04:57 -08:00
2025-04-02 09:56:09 -07:00
2025-02-13 09:57:33 -08:00
2025-04-15 23:17:03 +02:00
2025-02-25 10:04:57 -08:00
2025-04-22 09:13:11 +08:00
2024-11-15 17:53:14 +08:00
2025-03-28 19:23:56 +00:00
2025-04-24 10:13:05 +03:00
2024-11-08 00:16:45 +08:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2025-01-31 14:05:34 -08:00
2024-11-27 11:14:51 -08:00
2024-12-12 11:24:07 +08:00
2025-04-25 17:12:27 -07:00
2025-04-28 19:35:11 -07:00
2024-11-15 17:53:14 +08:00
2025-03-28 19:23:56 +00:00
2024-07-17 13:06:58 -07:00
2025-02-19 12:11:00 -08:00
2025-03-28 19:23:56 +00:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2025-04-09 13:33:58 +08:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2024-12-10 12:37:45 -08:00
2025-01-16 11:58:42 -08:00
2024-10-02 16:33:31 -07:00
2024-10-02 16:33:31 -07:00
2025-01-28 21:03:12 +05:30
2024-11-06 00:20:21 +03:00
2024-11-06 00:20:21 +03:00
2024-11-06 00:20:21 +03:00
2025-03-06 09:28:44 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2025-03-28 19:23:56 +00:00
2025-03-28 19:23:56 +00:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2025-02-13 09:57:33 -08:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2024-11-15 17:53:14 +08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-03-28 19:23:56 +00:00
2024-11-15 17:53:14 +08:00
2025-02-13 09:57:33 -08:00
2024-11-06 19:30:32 +03:00
2024-12-04 13:40:02 +08:00
2024-07-15 12:42:44 +08:00
2024-11-06 00:20:21 +03:00
2024-08-28 12:48:20 +01:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2025-05-06 09:57:07 +08:00
2024-11-06 00:20:21 +03:00
2024-07-15 10:25:25 +10:00
2024-12-31 10:56:28 +08:00
2025-04-07 23:45:54 +07:00
2025-03-05 10:59:45 -08:00
2025-04-23 17:36:00 -07:00
2025-04-23 17:36:00 -07:00
2025-03-05 10:59:45 -08:00
2025-03-05 10:59:45 -08:00
2025-04-23 17:36:00 -07:00
2025-04-23 17:36:00 -07:00
2025-04-22 15:40:03 +05:30
2025-04-16 06:48:56 +05:30
2025-04-16 11:19:13 +05:30
2025-04-16 13:10:56 +05:30
2024-12-10 17:57:04 -08:00
2024-11-15 17:53:14 +08:00
2025-02-19 12:11:00 -08:00
2025-02-13 09:57:33 -08:00
2025-04-23 14:47:42 -07:00
2025-04-07 20:47:21 +02:00
2025-03-28 19:23:56 +00:00
2025-03-28 19:23:56 +00:00
2025-04-23 17:36:00 -07:00
2025-03-05 10:59:45 -08:00
2025-01-28 21:03:12 +05:30
2024-11-06 00:20:21 +03:00
2025-04-23 17:36:00 -07:00
2025-02-13 09:57:33 -08:00
2025-02-13 09:57:33 -08:00
2024-11-06 00:20:21 +03:00
2025-01-27 22:10:51 -08:00
2025-04-21 11:02:04 +08:00
2024-11-25 16:12:45 -08:00
2024-11-25 16:12:45 -08:00
2024-09-01 12:15:00 -07:00