diff options
| author | bors <bors@rust-lang.org> | 2021-01-12 22:58:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-01-12 22:58:42 +0000 |
| commit | 058a71016553f267ae80b90276ef79956457d51a (patch) | |
| tree | 9cd990416b0821aaa898a16bca44205fd92a4bba /compiler/rustc_codegen_llvm/src | |
| parent | 7a9b552cb1621c9c57898d147228aab32b65a7c3 (diff) | |
| parent | e608d8f4e5e8e33b5d480323596d2aeabd129e4f (diff) | |
| download | rust-058a71016553f267ae80b90276ef79956457d51a.tar.gz rust-058a71016553f267ae80b90276ef79956457d51a.zip | |
Auto merge of #79670 - Nadrieril:uninhabited-query, r=estebank
Turn type inhabitedness into a query to fix `exhaustive_patterns` perf We measured in https://github.com/rust-lang/rust/pull/79394 that enabling the [`exhaustive_patterns` feature](https://github.com/rust-lang/rust/issues/51085) causes significant perf degradation. It was conjectured that the culprit is type inhabitedness checking, and [I hypothesized](https://github.com/rust-lang/rust/pull/79394#issuecomment-733861149) that turning this computation into a query would solve most of the problem. This PR turns `tcx.is_ty_uninhabited_from` into a query, and I measured a 25% perf gain on the benchmark that stress-tests `exhaustiveness_patterns`. This more than compensates for the 30% perf hit I measured [when creating it](https://github.com/rust-lang/rustc-perf/pull/801). We'll have to measure enabling the feature again, but I suspect this fixes the perf regression entirely. I'd like a perf run on this PR obviously. I made small atomic commits to help reviewing. The first one is just me discovering the "revisions" feature of the testing framework. I believe there's a push to move things out of `rustc_middle` because it's huge. I guess `inhabitedness/mod.rs` could be moved out, but it's quite small. `DefIdForest` might be movable somewhere too. I don't know what the policy is for that. Ping `@camelid` since you were interested in following along `@rustbot` modify labels: +A-exhaustiveness-checking
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
