-
Notifications
You must be signed in to change notification settings - Fork 562
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
Refactored const-folding. #6070
Conversation
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 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)
crates/cairo-lang-lowering/src/optimizations/const_folding.rs
line 179 at r1 (raw file):
nz_fns: UnorderedHashSet<FunctionId>, /// The storage access module. storage_access_module: ModuleHelper<'a>,
Consider making these a sub-struct.
Code quote:
// The required ids for optimizations.
/// The `felt252_sub` libfunc.
felt_sub: FunctionId,
/// The `into_box` libfunc.
into_box: ExternFunctionId,
/// The `upcast` libfunc.
upcast: ExternFunctionId,
/// The `storage_base_address_from_felt252` libfunc.
storage_base_address_from_felt252: FunctionId,
/// The set of functions that check if a number is zero.
nz_fns: UnorderedHashSet<FunctionId>,
/// The storage access module.
storage_access_module: ModuleHelper<'a>,
e939cef
to
d9ffee0
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 all commit messages.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @orizi)
crates/cairo-lang-lowering/src/optimizations/const_folding.rs
line 337 at r2 (raw file):
/// The storage access module. storage_access_module: ModuleHelper<'a>, }
Maybe it should really be static with once_cell::Lazy
?
Code quote:
/// Holds static information about libfuncs required for the optimization.
struct LibfuncInfo<'a> {
/// The `felt252_sub` libfunc.
felt_sub: FunctionId,
/// The `into_box` libfunc.
into_box: ExternFunctionId,
/// The `upcast` libfunc.
upcast: ExternFunctionId,
/// The `storage_base_address_from_felt252` libfunc.
storage_base_address_from_felt252: FunctionId,
/// The set of functions that check if a number is zero.
nz_fns: UnorderedHashSet<FunctionId>,
/// The storage access module.
storage_access_module: ModuleHelper<'a>,
}
d9ffee0
to
20bba5d
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 1 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)
crates/cairo-lang-lowering/src/optimizations/const_folding.rs
line 337 at r2 (raw file):
Previously, gilbens-starkware (Gil Ben-Shachar) wrote…
Maybe it should really be static with
once_cell::Lazy
?
cannot be - but can become a db query - but will get to it when actually required.
commit-id:605c1c38
20bba5d
to
29c2728
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 1 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @orizi)
Stack:
This change is