Skip to content
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

feat: optimization field (simpleCounterForLoopUncheckedIncrement) #100

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/artifacts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ impl Settings {
// with only unused prunner step
optimizer_steps: Some("u".to_string()),
}),
simple_counter_for_loop_unchecked_increment: Some(true),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sense, default is true, and we can set it

});
self
}
Expand Down Expand Up @@ -750,6 +751,10 @@ pub struct OptimizerDetails {
/// Tuning options for the Yul optimizer.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub yul_details: Option<YulDetails>,
/// Use unchecked arithmetic when incrementing the counter of for loops
/// under certain circumstances. It is always on if no details are given.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub simple_counter_for_loop_unchecked_increment: Option<bool>,
}

// === impl OptimizerDetails ===
Expand All @@ -766,6 +771,7 @@ impl OptimizerDetails {
&& self.constant_optimizer.is_none()
&& self.yul.is_none()
&& self.yul_details.as_ref().map(|yul| yul.is_empty()).unwrap_or(true)
&& self.simple_counter_for_loop_unchecked_increment.is_none()
}
}

Expand Down
Loading