-
Notifications
You must be signed in to change notification settings - Fork 1
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
WIP: Trying to promote const local array using GVN pass #5
Conversation
// [255, 105, 15, 39, 62, 251, 191, 178, 9, 4, 56, 221], | ||
// [193, 164, 194, 197, 6, 243, 218, 171, 87, 247, 104, 42], | ||
// ]; | ||
let _darr = *&[ |
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.
This returns Some(OpTy { op: Indirect(MemPlace { ptr: alloc2<imm>, meta: None, misaligned: None }), ty: [i32; 32] })
// CHECK: let [[array_lit:_.*]]: [i32; 32]; | ||
// CHECK: debug _arr => [[arr:_.*]]; | ||
|
||
let _arr = [ |
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.
With commits[3], this now returns as a immutable memplace: Some(OpTy { op: Indirect(MemPlace { ptr: alloc3<imm>, meta: None, misaligned: None }), ty: [i32; 32] })
.
But in the mir diff, _arr still is not promoted.
Rewriting of rust-lang#125916 which used PromoteTemps pass.
Current status
commits[1..]
doesn't change the test diff.I'm trying to returnThat is not enough to promote the array.OpTy { op: Indirect(MemPlace { .. }), ty: [i32; 32] }
foreval_to_const(array)
. Becauseeval_to_const(*&array)
is returning a similiar value.