-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Accelerate GVN a little #126991
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
Accelerate GVN a little #126991
Changes from all commits
a0b4d6d
95986dd
70ee6e4
9d23c86
61ef044
98c1ea8
4067795
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,12 +22,11 @@ | |
StorageLive(_3); | ||
StorageLive(_4); | ||
_9 = const main::promoted[0]; | ||
- _4 = _9; | ||
_4 = _9; | ||
- _3 = _4; | ||
- _2 = move _3 as &[u32] (PointerCoercion(Unsize)); | ||
+ _4 = const {ALLOC0<imm>: &[u32; 3]}; | ||
+ _3 = const {ALLOC0<imm>: &[u32; 3]}; | ||
+ _2 = const {ALLOC0<imm>: &[u32; 3]} as &[u32] (PointerCoercion(Unsize)); | ||
+ _3 = _9; | ||
+ _2 = _9 as &[u32] (PointerCoercion(Unsize)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @saethlin this is this kind of pattern. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So are you saying there consts that get their allocations dumped, and some consts that don't? That seems like an undesirable property of MIR dumps, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea, Ideally promoteds would just be regular statics, but lazily created in the MIR opt pipeline. This is blocked on various works around There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Statics can't be generic so IMO they should be regular consts. |
||
StorageDead(_3); | ||
StorageLive(_6); | ||
_6 = const 1_usize; | ||
|
@@ -50,6 +49,4 @@ | |
return; | ||
} | ||
} | ||
+ | ||
+ ALLOC0 (size: 12, align: 4) { .. } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think you could get this from the passed-in
body
now, rather than needing the parameter?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they have different lifetimes. The caller will want to mutate part of the body, so we can only keep a reference to the local decls.