-
Notifications
You must be signed in to change notification settings - Fork 489
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
Fix block merge under loop #3770
Fix block merge under loop #3770
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
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 6 files at r1, all commit messages.
Reviewable status: 3 of 6 files reviewed, 3 unresolved discussions (waiting on @spapinistarkware)
crates/cairo-lang-lowering/src/lower/block_builder.rs
line 100 at r1 (raw file):
); self.changed_semantics.insert(member_path); }
Suggestion:
pub fn update_ref(
&mut self,
ctx: &mut LoweringContext<'_, '_>,
member_path: &ExprVarMemberPath,
var: VariableId,
) {
let location = ctx.get_location(member_path.stable_ptr().untyped());
self.update_ref_raw(ctx, member_path, var, location)
}
pub fn update_ref_raw(
&mut self,
ctx: &mut LoweringContext<'_, '_>,
member_path: MemberPath,
var: VariableId,
location: LocationId,
) {
self.semantics.update(
BlockStructRecomposer { statements: &mut self.statements, ctx, location },
&member_path,
var,
);
self.changed_semantics.insert(member_path);
}
crates/cairo-lang-lowering/src/lower/block_builder.rs
line 114 at r1 (raw file):
) .map(|var_id| VarUsage { var_id, location }) }
Suggestion:
pub fn get_ref(
&mut self,
ctx: &mut LoweringContext<'_, '_>,
member_path: &ExprVarMemberPath,
) -> Option<VarUsage> {
let location = ctx.get_location(member_path.stable_ptr().untyped());
self.get_ref_raw(ctx, member_path, location)
}
crates/cairo-lang-lowering/src/lower/refs.rs
line 15 at r1 (raw file):
#[derive(Clone, Default, Debug)] pub struct SemanticLoweringMapping { pub scattered: OrderedHashMap<MemberPath, Value>,
is this used?
Suggestion:
pub struct SemanticLoweringMapping {
scattered: OrderedHashMap<MemberPath, Value>,
e2dc346
to
fc1b6fc
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: 3 of 6 files reviewed, 3 unresolved discussions (waiting on @orizi)
crates/cairo-lang-lowering/src/lower/block_builder.rs
line 100 at r1 (raw file):
); self.changed_semantics.insert(member_path); }
Done.
crates/cairo-lang-lowering/src/lower/block_builder.rs
line 114 at r1 (raw file):
) .map(|var_id| VarUsage { var_id, location }) }
Done.
crates/cairo-lang-lowering/src/lower/refs.rs
line 15 at r1 (raw file):
Previously, orizi wrote…
is this used?
Done.
fc1b6fc
to
f5eb8ab
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.
Reviewed 1 of 6 files at r1, 5 of 5 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @spapinistarkware)
This change is