about summary refs log tree commit diff
path: root/src/test/ui/iterators/iter-sum-overflow-debug.rs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2019-10-21 19:53:04 +0900
committerGitHub <noreply@github.com>2019-10-21 19:53:04 +0900
commitbcc59ac2298f8cb61129f8417d15f2ba6994ac3c (patch)
tree96b94e5e5b67c31d7b250d75a6179a610247e711 /src/test/ui/iterators/iter-sum-overflow-debug.rs
parent7ea9cfc1fb95b493b5b2bba3934018ed0ae59c67 (diff)
parent2ec73395b985a028062cc40faed6ace50be0c67d (diff)
downloadrust-bcc59ac2298f8cb61129f8417d15f2ba6994ac3c.tar.gz
rust-bcc59ac2298f8cb61129f8417d15f2ba6994ac3c.zip
Rollup merge of #65624 - wesleywiser:improve_simplify_locals, r=oli-obk
[mir-opt] Improve SimplifyLocals pass so it can remove unused consts

The `ConstProp` can cause many locals to be initialized to a constant
value and then never read from. `ConstProp` can also evaluate ZSTs into
constant values. Previously, many of these would be removed by other
parts of the MIR optimization pipeline. However, evaluating ZSTs
(especially `()`) into constant values defeated those parts of the
optimizer and so in a2e3ed5, I added a
hack to `ConstProp` that skips evaluating ZSTs to avoid that regression.

This commit changes `SimplifyLocals` so that it doesn't consider writes
of const values to a local to be a use of that local. In doing so,
`SimplifyLocals` is able to remove otherwise unused locals left behind
by other optimization passes (`ConstProp` in particular).

r? @oli-obk
Diffstat (limited to 'src/test/ui/iterators/iter-sum-overflow-debug.rs')
0 files changed, 0 insertions, 0 deletions