-
Notifications
You must be signed in to change notification settings - Fork 596
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
Handlng zero sized locals. #4414
Conversation
why is this needed? Code quote: // All empty variables are not ap based.
lowered_function.variables.iter().filter_map(|(id, var)| {
let info = db.get_type_info(db.get_concrete_type_id(var.ty).ok()?).ok()?;
if info.zero_sized { Some(id) } else { None }
}) |
does this miss things? Code quote: | OutputVarReferenceInfo::ZeroSized => {
self.non_ap_based.insert(*var); |
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.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware and @ilyalesokhin-starkware)
crates/cairo-lang-sierra-generator/src/local_variables.rs
line 59 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
why is this needed?
since we need all zero sized variables to be dropped.
a variable merged from a branch where it is used, is stored in one branch and not dropped in the other.
The issue test crashes.
crates/cairo-lang-sierra-generator/src/local_variables.rs
line 297 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
does this miss things?
yes - since merge does not catch it.
Previously, orizi wrote…
why do we need all zero sized variables to be dropped? |
Previously, orizi wrote…
does not catch what? |
f08931e
to
a025eb1
Compare
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.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware and @ilyalesokhin-starkware)
crates/cairo-lang-sierra-generator/src/local_variables.rs
line 59 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
why do we need all zero sized variables to be dropped?
since we need all variables to be dropped.
zero sized variables are treated as temporary variables when merged (all other merged introduced variables ARE always tempvars at the end of the stack).
Therefore 0 sized require special handling.
crates/cairo-lang-sierra-generator/src/local_variables.rs
line 297 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
does not catch what?
merge assumes all is temp var - zero sized included.
Previously, orizi wrote…
wdyt about only hanlind remapped variables? |
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.
Reviewed all commit messages.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)
crates/cairo-lang-sierra-generator/src/local_variables.rs
line 297 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
wdyt about only hanlind remapped variables?
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.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)
crates/cairo-lang-sierra-generator/src/local_variables.rs
line 297 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
I'm also ok with you approach, but I think it is less in the spirt of rest of the code.
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.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware and @ilyalesokhin-starkware)
crates/cairo-lang-sierra-generator/src/local_variables.rs
line 297 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
I'm also ok with you approach, but I think it is less in the spirt of rest of the code.
i'm fine with it, i think the code is built to handle logically temporary values, so any way to ignore them is fine with me.
Previously, orizi wrote…
what do you mean by "logically temporary values"? |
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.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware and @ilyalesokhin-starkware)
crates/cairo-lang-sierra-generator/src/local_variables.rs
line 297 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
what do you mean by "logically temporary values"?
i mean to exclude empty vars.
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.
Reviewed 3 of 3 files at r1.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @gilbens-starkware)
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.
Reviewed 2 of 3 files at r1, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @orizi)
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.
Reviewed 1 of 3 files at r1.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @orizi)
This change is