mlugg
407dc6eee4
Liveness: avoid emitting unused instructions or marking their operands as used
...
Backends want to avoid emitting unused instructions which do not have
side effects: to that end, they all have `Liveness.isUnused` checks for
many instructions. However, checking this in the backends avoids a lot
of potential optimizations. For instance, if a nested field is loaded,
then the first field access would still be emitted, since its result is
used by the next access (which is then unreferenced).
To elide more instructions, Liveness can track this data instead. For
operands which do not have to be lowered (i.e. are not side effecting
and are not something special like `arg), Liveness can ignore their
operand usages, and push the unused information further up, potentially
marking many more instructions as unreferenced.
In doing this, I also uncovered a bug in the LLVM backend relating to
discarding the result of `@cVaArg`, which this change fixes. A behaviour
test has been added to cover it.
2023-04-20 20:28:48 +01:00
..
2023-04-16 17:07:07 -04:00
2021-04-29 15:54:04 -07:00
2021-04-29 15:54:04 -07:00
2021-04-29 15:54:04 -07:00
2021-04-29 15:54:04 -07:00
2022-12-10 21:51:46 +07:00
2023-04-02 04:49:53 -04:00
2022-12-27 21:17:52 +08:00
2023-04-20 09:05:22 -07:00
2023-02-21 15:46:34 -05:00
2022-12-06 19:06:48 -07:00
2023-04-15 10:33:08 -07:00
2022-12-06 19:06:48 -07:00
2023-04-02 04:49:53 -04:00
2023-03-15 01:04:21 -04:00
2023-04-02 04:49:53 -04:00
2023-03-15 01:04:21 -04:00
2021-10-28 17:33:05 -07:00
2023-04-02 04:49:53 -04:00
2023-03-15 01:04:21 -04:00
2023-03-15 01:04:21 -04:00
2023-03-21 08:49:54 +01:00
2023-04-02 04:49:53 -04:00
2023-04-15 10:33:08 -07:00
2023-03-17 01:56:36 -04:00
2023-04-07 01:29:20 +01:00
2022-02-13 14:42:20 +02:00
2023-04-02 04:49:53 -04:00
2022-12-23 23:10:04 +02:00
2022-12-23 23:10:04 +02:00
2023-03-25 16:23:55 -04:00
2022-11-04 23:13:50 +02:00
2023-04-16 17:05:35 -04:00
2023-04-03 18:02:55 +02:00
2023-04-12 12:06:19 -04:00
2022-10-25 05:11:28 -04:00
2023-03-21 15:04:39 +02:00
2023-03-03 18:42:29 +01:00
2023-04-15 10:33:08 -07:00
2022-12-10 21:51:46 +07:00
2021-05-08 14:45:21 -07:00
2023-03-25 16:23:55 -04:00
2023-04-07 01:29:20 +01:00
2023-03-15 01:04:21 -04:00
2021-05-08 14:45:21 -07:00
2022-03-11 12:59:20 -07:00
2023-04-02 18:05:44 +03:00
2022-01-07 00:06:06 -05:00
2022-12-10 21:51:46 +07:00
2023-03-15 01:04:21 -04:00
2023-04-02 05:16:46 -04:00
2023-02-21 09:43:23 -05:00
2023-04-02 04:49:53 -04:00
2023-04-03 17:45:16 +02:00
2022-12-10 21:51:46 +07:00
2023-03-25 16:23:55 -04:00
2023-04-15 10:33:08 -07:00
2023-03-21 08:49:54 +01:00
2023-03-15 01:04:21 -04:00
2023-03-21 08:49:54 +01:00
2023-04-15 10:33:08 -07:00
2022-03-17 11:39:56 -07:00
2023-03-21 08:49:54 +01:00
2023-04-02 04:49:53 -04:00
2023-03-25 16:23:55 -04:00
2023-04-02 04:49:53 -04:00
2023-04-13 04:17:47 -04:00
2023-03-05 02:59:01 -05:00
2021-12-11 00:29:31 +01:00
2023-03-21 08:49:54 +01:00
2021-05-08 14:45:21 -07:00
2023-03-15 01:04:21 -04:00
2023-03-15 01:04:21 -04:00
2023-03-21 08:49:54 +01:00
2022-12-10 21:51:46 +07:00
2023-03-05 02:59:02 -05:00
2023-04-07 20:55:04 -04:00
2023-03-15 01:04:21 -04:00
2021-06-21 17:03:03 -07:00
2023-04-07 01:29:20 +01:00
2023-03-21 00:34:12 +02:00
2023-03-15 01:04:21 -04:00
2022-12-27 21:17:52 +08:00
2023-04-16 17:05:35 -04:00
2023-04-03 18:02:55 +02:00
2023-04-03 18:02:55 +02:00
2023-04-05 14:45:56 +03:00
2022-12-10 21:51:46 +07:00
2023-03-25 16:23:55 -04:00
2022-09-10 01:50:17 +03:00
2022-11-03 14:07:00 +02:00
2023-03-25 16:23:55 -04:00
2023-03-05 02:59:02 -05:00
2022-12-29 11:12:08 +01:00
2023-03-25 16:23:55 -04:00
2023-03-25 16:23:55 -04:00
2023-03-25 16:23:55 -04:00
2023-03-25 16:23:55 -04:00
2023-04-02 04:49:53 -04:00
2022-12-27 21:17:52 +08:00
2022-12-27 21:17:52 +08:00
2023-03-15 01:04:21 -04:00
2023-04-02 18:05:44 +03:00
2022-12-10 21:51:46 +07:00
2023-04-20 20:28:48 +01:00
2023-04-15 10:33:08 -07:00
2023-03-15 01:04:21 -04:00
2022-03-03 18:31:55 -07:00
2023-03-21 08:49:54 +01:00
2023-04-15 10:33:08 -07:00
2022-01-29 18:12:28 +02:00