diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2019-10-21 19:53:04 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-21 19:53:04 +0900 |
| commit | bcc59ac2298f8cb61129f8417d15f2ba6994ac3c (patch) | |
| tree | 96b94e5e5b67c31d7b250d75a6179a610247e711 /src/test/ui/iterators/iter-sum-overflow-debug.rs | |
| parent | 7ea9cfc1fb95b493b5b2bba3934018ed0ae59c67 (diff) | |
| parent | 2ec73395b985a028062cc40faed6ace50be0c67d (diff) | |
| download | rust-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
