Uh oh!
There was an error while loading. Please reload this page.
Liveness analysis for everybody - #77281
Conversation
rust-highfive
commented
Sep 27, 2020
r? @oli-obk (rust_highfive has picked a reviewer for you, use r? to override) |
ffe0c44 to
e39c078Compare
lcnr
left a comment
There was a problem hiding this comment.
LGTM!
I don't have too much experience with this code though, so I won't r+ this myself yet
Uh oh!
There was an error while loading. Please reload this page.
oli-obk
commented
Sep 28, 2020
@bors try @rust-timer queue I don't care whether this has a perf impact, but I'd like to know before merging so we make a concious decision about it |
rust-timer
commented
Sep 28, 2020
Awaiting bors try build completion |
bors
commented
Sep 28, 2020
⌛ Trying commit e39c078321402714fafe8907a275515637bcfb9d with merge 775f8455dd97e8fb2f22eeb9a943bece2c4a64f4... |
There was a problem hiding this comment.
Not sure if the parent relation in the DefId space is set up like this, but can you try whether
ifletSome(parent) = self.tcx.parent(def_id){ifself.tcx.has_attr(parent, sym::automatically_derived){return;}}also works? If so, please use that
There was a problem hiding this comment.
Yep, that works as well.
Part of the motivation for the current form of the check was to avoid using the automatically_derived attribute if it were to occur in completely unexpected place, like a crate or a module. Should I change it anyway?
There was a problem hiding this comment.
I think we should prevent such uses via other means, but you can also add an assert_eq!(self.tcx.def_kind(parent), DefKind::Impl) before the return to make sure.
There was a problem hiding this comment.
We do not prevent such uses this right now, so I used this as a part of condition. I would like to be extra conservative about any additional uses of this attribute since I think it is stabilized unintentionally and its purpose has changed over time.
There was a problem hiding this comment.
oh :/ that's not great. Yea let's go with a non-panicking version for now
bors
commented
Sep 28, 2020
☀️ Try build successful - checks-actions, checks-azure |
rust-timer
commented
Sep 28, 2020
Queued 775f8455dd97e8fb2f22eeb9a943bece2c4a64f4 with parent 535d27a, future comparison URL. |
rust-timer
commented
Sep 28, 2020
Finished benchmarking try commit (775f8455dd97e8fb2f22eeb9a943bece2c4a64f4): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
Perform liveness analysis for every body instead of limiting it to fns.
e39c078 to
924e8aaComparetmiasko
commented
Sep 29, 2020
The performance impact is limited, except for the many-assoc-items benchmark which contains mostly associated consts. To a large degree we were paying the price of the computation already. The previous code was creating variables and lives nodes for all bodies, it just didn't always run the liveness analysis. Furthermore, when the liveness analysis didn't run, the live nodes and variables were included in the analysis of a parent if any. |
oli-obk
commented
Sep 30, 2020
@bors r+ I was expecting some sort of perf hit on assoc const heavy code, but this is a bugfix, so let's roll with it |
bors
commented
Sep 30, 2020
📌 Commit 924e8aa has been approved by |
bors
commented
Sep 30, 2020
bors
commented
Sep 30, 2020
☀️ Test successful - checks-actions, checks-azure |
Perform liveness analysis for every body instead of limiting it to fns.
Fixes#77169.