-
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
[MIR] when should we not deaggregate? #35259
Comments
I can’t think of a trivial way to reverse deaggregation, especially after multiple optimisation passes go through the MIR. The newtype concern raised by Ariel could be easily handled by replacing
with
(This is probably the same thing as SRoA, which @eddyb mentioned) This likely would allow us to discard some of the |
That being said, I feel like LLVM should be more than capable to handle such case quite quickly by itself. |
@nagisa There's 2 reasons SRoA isn't enough to replace Newtypes (including those with extra ZST fields) are more relevant because of "zero-cost abstractions". |
@nagisa I think the issue is about not deaggregating in some cases, rather than trying to reverse it. |
I have a prototype of optimizing through fields of locals and it's much more straight-forward to do it after deaggregation than trying to understand the creation of aggregates as a whole. |
#107267 fixed this, right? |
#35168 adds the capability of deaggregating structs like:
Into:
But, one could imagine situations where this is counter productive.
It's not clear if this should be handled by the Deaggregator or MIR trans.
The text was updated successfully, but these errors were encountered: