rust/tests
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
..
assembly Auto merge of #138503 - bjorn3:string_merging, r=tmiasko 2025-03-28 10:18:32 +00:00
auxiliary tests: use minicore more 2025-02-24 09:26:54 +00:00
codegen Auto merge of #132527 - DianQK:gvn-stmt-iter, r=oli-obk 2025-04-03 19:17:33 +00:00
codegen-units Remove -Zinline-in-all-cgus and clean up CGU partitioning tests 2025-01-27 23:48:47 -05:00
coverage Bless tests 2025-04-02 19:59:26 +08:00
coverage-run-rustdoc Update coverage-run-rustdoc output 2025-03-28 10:35:53 +01:00
crashes Rollup merge of #135295 - eyraudh:master, r=compiler-errors 2025-04-02 13:10:36 +11:00
debuginfo Rollup merge of #137967 - mustartt:fix-aix-test-hangs, r=workingjubilee 2025-03-11 13:30:50 +01:00
incremental Rollup merge of #139153 - compiler-errors:incr-comp-closure, r=oli-obk 2025-03-31 14:36:22 +02:00
mir-opt Auto merge of #132527 - DianQK:gvn-stmt-iter, r=oli-obk 2025-04-03 19:17:33 +00:00
pretty Auto merge of #138492 - lcnr:rm-inline_const_pat, r=oli-obk 2025-04-01 14:20:46 +00:00
run-make Rollup merge of #139239 - jieyouxu:run-make-aux-build, r=Kobzol 2025-04-02 22:52:47 +09:00
rustdoc Correctly handle line comments in attributes and generate extern crates 2025-03-27 11:18:43 +01:00
rustdoc-gui Rollup merge of #137539 - GuillaumeGomez:copy-content-tests, r=notriddle 2025-02-25 13:07:34 +01:00
rustdoc-js
rustdoc-js-std Remove the common prelude module 2025-02-11 13:04:27 -08:00
rustdoc-json rustdoc-json: Add test for #[automatically_derived] attribute 2025-03-31 20:42:49 +00:00
rustdoc-ui compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
ui Auto merge of #139301 - matthiaskrgr:rollup-sa6ali8, r=matthiaskrgr 2025-04-03 15:31:20 +00:00
ui-fulldeps compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
COMPILER_TESTS.md