Uh oh!
There was an error while loading. Please reload this page.
Intern predicates - #72055
Conversation
Uh oh!
There was an error while loading. Please reload this page.
nikomatsakis
commented
May 11, 2020
Noting down some notes from Zulip: I actually started with
|
4a0e5af to
6df0cd6CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
lcnr
commented
May 11, 2020
Should be ready for review. r? @eddyb |
bors
commented
May 13, 2020
☔ The latest upstream changes (presumably #71451) made this pull request unmergeable. Please resolve the merge conflicts. |
bors
commented
May 16, 2020
☔ The latest upstream changes (presumably #72251) made this pull request unmergeable. Please resolve the merge conflicts. |
lcnr
commented
May 16, 2020
rebased |
rust-highfive
commented
May 16, 2020
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
nikomatsakis
commented
May 18, 2020
@bors r+ I'm going to snipe this review from @eddyb since they seem busy and, while I did author the first commit or two here, they're also fairly rote, and the majority of the work came afterwards anyhow. (And it follows more-or-less the rust-lang/compiler-team#285 MCP, although the FCP there has not fully expired.) |
bors
commented
May 18, 2020
📌 Commit 99483282a6da51f71bdc663bf26fe416bbd02464 has been approved by |
bors
commented
May 18, 2020
🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened |
lcnr
commented
May 20, 2020
This is once again ready 😅 |
nikomatsakis
commented
May 20, 2020
@bors r+ |
bors
commented
May 20, 2020
📌 Commit 3dd830b has been approved by |
nikomatsakis
commented
May 20, 2020
@bors delegate+ |
bors
commented
May 20, 2020
✌️ @lcnr can now approve this pull request |
Intern predicates Implements the first step of rust-lang/compiler-team#285 Renames `ty::Predicate` to `ty::PredicateKind`, which is now interned. To ease the transition, `ty::Predicate` is now a struct containing a reference to `ty::PredicateKind`. r? @ghost
Rollup of 7 pull requests Successful merges: - rust-lang#72055 (Intern predicates) - rust-lang#72149 (Don't `type_of` on trait assoc ty without default) - rust-lang#72347 (Make intra-link resolve links for both trait and impl items) - rust-lang#72350 (Improve documentation of `slice::from_raw_parts`) - rust-lang#72382 (Show default values for debug-assertions & debug-assertions-std) - rust-lang#72421 (Fix anchor display when hovering impl) - rust-lang#72425 (fix discriminant_value sign extension) Failed merges: r? @ghost
@lcnr The rollup containing this PR caused a large perf regression in trait solving. Was this expected? |
lcnr
commented
May 23, 2020
Not by this much 😅 There is one problem which I should be able to get a PR ready today, but a small regression is probably expected... |
mati865
commented
May 23, 2020
@lcnr@nikomatsakis please use |
nnethercote
commented
May 25, 2020
Note that this was also a max-rss regression. max-rss measurements are noisy, but the change was big enough for the regression to be clear on the graphs. |
nnethercote
commented
May 25, 2020
@lcnr: please do a perf CI run before landing if a PR is expected/suspected to affect performance.
What is the status of this? |
lcnr
commented
May 26, 2020
It ended up being part of #72494 which fixes about 1/3 of of this regression if I understand it correctly. |
nikomatsakis
commented
May 27, 2020
(I didn't really expect there to be much perf regression, but it would've been prudent to test.) |
Pass more `Copy` types by value. There are a lot of locations where we pass `&T where T: Copy` by reference, which should both be slightly less performant and less readable IMO. This PR currently consists of three fairly self contained commits: - passes `ty::Predicate` by value and stops depending on `AsRef<ty::Predicate>`. - changes `<&List<_>>::into_iter` to iterate over the elements by value. This would break `List`s of non copy types. But as the only list constructor requires `T` to be copy anyways, I think the improved readability is worth this potential future restriction. - passes `mir::PlaceElem` by value. Mir currently has quite a few copy types which are passed by reference, e.g. `Local`. As I don't have a lot of experience working with MIR, I mostly did this to get some feedback from people who use MIR more frequently - tries to reuse `ty::Predicate` in case it did not change in some places, which should hopefully fix the regression caused by rust-lang#72055 r? @nikomatsakis for the first commit, which continues the work of rust-lang#72055 and makes adding `PredicateKind::ForAll` slightly more pleasant. Feel free to reassign though
Implements the first step of rust-lang/compiler-team#285
Renames
ty::Predicatetoty::PredicateKind, which is now interned.To ease the transition,
ty::Predicateis now a struct containing a referenceto
ty::PredicateKind.r? @ghost