-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
attempt to recover perf by removing exports_all_green
#71267
attempt to recover perf by removing exports_all_green
#71267
Conversation
…ll_green` flag. (My hypothesis is that my use of this flag was an overly conservative generalization of PR 67020.)
(rust_highfive has picked a reviewer for you, use r? to override) |
we should probably at least consider rolling this in with the current beta, if we can, considering it is a high priority follow-up to PR #71131 On the other hand, given that we were willing to let PR #71131 land without the performance issue addressed, it would also be entirely fine if we let this PR ride the trains. still, marking as beta-nominated to make it clear that that this is a question that we should try to resolve across the team, if we can do so quickly... cc @rust-lang/compiler |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 1abfd4a with merge afdbd8d1f31ef963fbfe54dc8a987f5bee3f1a29... |
@bors r+, but it would perhaps be great if we could explain why it is fine to remove this in a way that isn’t just a hunch. |
err, @bors r-, but r=me on implementation |
☀️ Try build successful - checks-azure |
Queued afdbd8d1f31ef963fbfe54dc8a987f5bee3f1a29 with parent ce93331, future comparison URL. |
r? @nagisa |
Perf results have landed, but there was no notification from the bot. |
Assuming I've done this right, this is the outer/inner range breakdown:
The difference between those two should be the remaining regressions, and they are:
|
Yeah, I had some idle moments over the past few days wondering if this was truly justifiable, and if so, what the justification is. With the code prior to this PR, the LTO optimization of a module is sensitive to (a.) what collection of modules it imports from (just as a set of names), (b.) what collection of modules it exports to (again, just as a set of names), (c.) whether the content of any of its imports has changed, and (d.) whether the content of any of the modules it exports to has changed. With this PR in place, we keep conditions (a.), (b.) and (c.); only (d.) is removed. We have lots of attached discussion justifying why we needed to add (a.) and (b.). Condition (c.) has been there since the beginning, I think. The justification for (c.) is that LLVM is allowed to use the content of the modules we import from in the LTO optimization of the current module. (Otherwise there wouldn't be much point in doing link-time optimization, right?) So the question is, can LLVM do optimizations based on the content of the modules that the current module exports to?
Do I expect LLVM might be using this kind of optimization? I wasn't sure, so I decided to go check the docs. The docs then point to the LLVM blog post on ThinLTO, where it literally says:
Note how items 2 and 3 there are written: item 2 corresponds exactly to conditions (a.) and (b.). Item 3 corresponds to condition (c.). And they do not say anything about changes to modules that we export to; that is, I think that serves as a promise from LLVM that we can drop condition (d.) |
I'll add a commit with a comment that restates the above, perhaps a bit more tersely. |
@bors r=nagisa rollup=never (performance sensitive PR, thus rollup=never) |
📌 Commit 19e5a65 has been approved by |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 19e5a65 has been approved by |
Thanks @eddyb ! I'll try to look into these cases next! (But I think its safe to say that these regressions we are probably willing to stomach in exchange for correctness...) |
@bors p=1 |
after discussion with @Mark-Simulacrum , I'm going to insta-beta-accept this (that is, I'm bypassing the beta-nomination process). I'm also marking this I-nominated so that we remember to discuss this at this week's Thursday meeting, so that if someone wants to object (either to the PR itself or to the process I followed, we will give the opportunity to do so there. (Or they can just post comments here if they object too...) |
Note that by that meeting it is highly likely we'll have already released this into stable -- so @rust-lang/compiler -- please chime in before then if you object to this getting released. (We can rebuild stable as late as ~Wednesday, most likely, though obviously the earlier the better). |
…imulacrum [stable] 1.43.0 release Includes a last minute backport of rust-lang#71267.
☀️ Test successful - checks-azure |
attempt to recover perf by removing
exports_all_green
flag.cc #71248
(My hypothesis is that my use of this flag was an overly conservative generalization of PR #67020.)