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

chore: Add missing IfElse simplification cases #6888

Closed
wants to merge 3 commits into from

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Dec 19, 2024

Description

Problem*

Resolves #6878

Summary*

Wanted a separate PR for this change so I could see the effect it had alone

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@jfecher jfecher changed the base branch from master to jf/unique-nots December 19, 2024 20:51
Copy link
Contributor

Peak Memory Sample

Program Peak Memory %
keccak256 78.48M 0%
workspace 123.81M 0%
regression_4709 422.91M 0%
ram_blowup_regression 1.58G 0%
private-kernel-tail 201.52M -3%
private-kernel-reset 716.79M 0%
private-kernel-inner 291.60M 0%
parity-root 171.90M 0%

Copy link
Contributor

Execution Sample

Program Execution Time %
sha256_regression 0.634s 3%
regression_4709 0.384s -6%
ram_blowup_regression 4.555s 4%
rollup-base-public 21.576s 3%
rollup-base-private 19.688s 3%
private-kernel-tail 0.708s 1%
private-kernel-reset 1.515s 3%
private-kernel-inner 0.986s -1%
parity-root 0.524s -3%

Copy link
Contributor

Compilation Sample

Program Compilation Time %
sha256_regression 1.385s -3%
regression_4709 0.791s -4%
ram_blowup_regression 15.728s 1%
rollup-base-public 114.708s -4%
rollup-base-private 95.672s 0%
private-kernel-tail 1.096s 3%
private-kernel-reset 7.667s 4%
private-kernel-inner 2.201s -5%
parity-root 0.735s -1%
noir-contracts 89.827s 2%

Base automatically changed from jf/unique-nots to master December 19, 2024 20:59
@jfecher
Copy link
Contributor Author

jfecher commented Dec 19, 2024

Somewhat unclear if this is beneficial or not

@TomAFrench
Copy link
Member

Yeah, I think this is a much less likely optimization tbh as we need to get reversed conditions as opposed to being able to simplify all of the if-elses in a particular branch which will naturally share the same condition.

@jfecher
Copy link
Contributor Author

jfecher commented Jan 2, 2025

Closing this for now, it's unclear that it's needed so I'm erring on the side of less code to maintain

@jfecher jfecher closed this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add handling for negated conditions when folding IfElse instructions.
2 participants