bors
00095b3da4
Auto merge of #132527 - DianQK:gvn-stmt-iter, r=oli-obk
...
gvn: Invalid dereferences for all non-local mutations
Fixes #132353 .
This PR removes the computation value by traversing SSA locals through `for_each_assignment_mut`.
Because the `for_each_assignment_mut` traversal skips statements which have side effects, such as dereference assignments, the computation may be unsound. Instead of `for_each_assignment_mut`, we compute values by traversing in reverse postorder.
Because we compute and use the symbolic representation of values on the fly, I invalidate all old values when encountering a dereference assignment. The current approach does not prevent the optimization of a clone to a copy.
In the future, we may add an alias model, or dominance information for dereference assignments, or SSA form to help GVN.
r? cjgillot
cc `@jieyouxu` #132356
cc `@RalfJung` #133474
2025-04-03 19:17:33 +00:00
..
2024-08-18 16:07:33 -07:00
2024-08-18 16:07:33 -07:00
2024-08-18 16:07:33 -07:00
2024-08-18 16:07:33 -07:00
2024-08-18 16:07:33 -07:00
2025-03-15 14:13:37 -07:00
2025-03-15 14:13:37 -07:00
2025-03-15 14:13:37 -07:00
2025-01-15 21:42:47 +01:00
2025-01-15 21:42:47 +01:00
2025-03-15 14:13:37 -07:00
2025-03-15 14:13:37 -07:00
2024-09-14 13:30:35 +08:00
2024-09-14 13:30:35 +08:00
2025-04-03 21:59:43 +08:00
2025-04-02 19:59:26 +08:00
2024-11-25 20:19:08 +01:00
2024-11-25 20:19:08 +01:00
2024-11-25 20:19:08 +01:00
2024-11-25 20:19:08 +01:00
2025-03-05 21:58:46 -08:00
2025-03-05 21:58:46 -08:00
2025-03-05 21:58:46 -08:00
2024-12-03 11:13:34 -08:00
2024-12-03 11:13:34 -08:00
2024-12-03 11:13:34 -08:00
2024-12-03 11:13:34 -08:00
2024-08-31 23:56:45 +02:00
2024-08-18 16:07:33 -07:00
2025-03-12 22:39:43 -07:00
2025-03-03 23:30:18 +00:00
2024-07-29 18:14:35 +08:00
2024-08-18 16:07:33 -07:00
2024-08-18 16:07:33 -07:00
2025-03-12 22:39:43 -07:00
2025-03-12 22:39:43 -07:00
2024-10-31 17:33:42 +08:00
2025-04-03 21:59:43 +08:00
2024-07-29 18:14:35 +08:00
2025-01-27 23:42:47 +00:00
2025-01-27 23:42:47 +00:00
2025-01-27 23:42:47 +00:00
2025-01-27 23:42:47 +00:00
2025-01-27 23:42:47 +00:00
2025-01-27 23:42:47 +00:00
2025-01-27 23:42:47 +00:00
2025-01-27 23:42:47 +00:00
2024-06-26 15:05:01 -07:00
2024-10-07 11:18:37 -04:00
2024-10-07 11:18:37 -04:00
2024-10-07 11:18:37 -04:00
2024-10-07 11:18:37 -04:00
2024-10-31 17:33:42 +08:00
2025-03-12 22:39:43 -07:00
2025-03-12 22:39:43 -07:00
2025-01-30 20:37:56 -07:00
2025-01-30 20:37:56 -07:00
2025-01-30 20:37:56 -07:00
2025-01-30 20:37:56 -07:00
2025-03-12 22:39:43 -07:00
2025-03-12 22:39:43 -07:00
2025-03-15 14:13:37 -07:00
2025-03-15 14:13:37 -07:00
2025-03-15 14:13:37 -07:00
2025-04-02 19:59:26 +08:00
2025-04-02 19:59:26 +08:00
2025-01-27 23:42:47 +00:00
2024-08-18 16:07:33 -07:00
2024-08-18 16:07:33 -07:00
2024-08-18 16:07:33 -07:00
2024-08-18 16:07:33 -07:00
2025-01-27 23:42:47 +00:00
2025-01-27 23:42:47 +00:00
2024-08-18 16:07:33 -07:00
2024-08-18 16:07:33 -07:00
2025-04-02 10:39:14 -07:00
2025-04-02 10:39:14 -07:00
2025-04-02 10:39:14 -07:00
2025-04-02 10:39:14 -07:00
2025-03-12 22:39:43 -07:00
2025-03-12 22:39:43 -07:00
2025-04-02 10:39:14 -07:00
2025-04-02 10:39:14 -07:00
2024-10-31 17:33:42 +08:00
2025-02-12 23:01:27 -08:00
2025-02-12 23:01:27 -08:00
2024-07-01 05:17:13 -07:00
2024-07-01 05:17:13 -07:00
2025-02-14 22:24:27 -08:00
2025-02-14 22:24:27 -08:00
2024-08-18 16:07:33 -07:00
2024-08-18 16:07:33 -07:00
2024-08-18 16:07:33 -07:00
2025-04-03 21:59:43 +08:00
2025-03-23 15:27:31 -07:00
2025-03-23 15:27:31 -07:00
2025-03-19 09:27:02 -07:00
2025-01-08 18:46:30 -08:00
2025-01-08 18:46:30 -08:00