-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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] implement zero-on-move #31449
[MIR] implement zero-on-move #31449
Conversation
Also remove these drop-glue i8 things… They for some reason make these completely non-MIR tests fail after dyndrop commit which has literally 0 changes around the regular old trans. Wut?
r? @jroesch (rust_highfive has picked a reviewer for you, use r? to override) |
NB: this is based on top of the initial dyndrop implementation PR. |
self.store_operand(bcx, dest.llval, operand); | ||
match operand.val { | ||
OperandValue::Ref(v) => self.drop_fill(bcx, v, operand.ty), | ||
OperandValue::Immediate(_) | |
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.
I’m not sure about Immediate
not needing any treatment here. Immediate
only happens if common::type_is_immediate
returns true, but to me it is not obvious that the function will never produce true
in case of type having a Drop
somewhere in it.
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.
Right, this cannot be ignored.
Also fix the tests to catch the double-drop on move.
Okay, so this won’t be as easy as I’ve initially thought. For example, call also consumes its arguments, although not through Sadly, zeroing after call is not as trivial as it sounds: worst-case introduces As for 2nd case… The alternative is to build a Any ideas, @nikomatsakis? |
base::call_memset(&build::B(bcx), llptr, filling, size, align, false); | ||
} | ||
|
||
pub fn set_operand_dropped(&mut self, |
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 also feels seriously hacky to me, but I don’t see an obvious way to dropflag-fill a OperandValue::Immediate
.
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.
You could use an out-of-line drop flag for these
☔ The latest upstream changes (presumably #31282) made this pull request unmergeable. Please resolve the merge conflicts. |
For example, one can do something like this |
(Did not mean to close.) |
I was proposing to @nagisa on IRC that we might want to restruct Example:
alternatively, Anyway, the goal here is to address the fact that the store only occurs when things succeed, and hopefully ease the translation to LLVM IR (and also ease dataflow somewhat -- @pnkfelix had to add some special cases here too). |
@nagisa sorry, I've kind of lost track of the state here. do you think we should land this as a "work in progress", or should we wait till we can get things working more completely? |
This is, we think, is the last piece necessary for the fully functional implementation of dynamic dropping in MIR.