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: loop keyword in runtime and comptime code #7096

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

asterite
Copy link
Collaborator

Description

Problem

No tracking issue, but implements loop in unconstrained and comptime code

Summary

Additional Context

Note that right now this doesn't work if there's no break inside a loop:

  • Function::returns() in SSA expect a return to be there
  • Inlining breaks because it can't find a return terminator

I also had to change some unrolling code that assumed there's an induction variable or a single instruction in a loop header, because now that's not true.

I'm not sure how to handle the inlining code... should we abandon the assumption that functions always have a return terminator? If so, how does the inlining code logic needs to change to handle that?

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.

Copy link
Contributor

Compilation Report

Program Compilation Time %
sha256_regression 0.982s -10%
regression_4709 0.776s -8%
ram_blowup_regression 16.100s -4%
rollup-root 3.720s 6%
rollup-merge 2.128s 0%
rollup-block-root-single-tx 138.000s 0%
rollup-block-root-empty 2.038s -2%
rollup-block-root 153.000s 9%
rollup-block-merge 3.668s 3%
rollup-base-public 27.960s -1%
rollup-base-private 10.080s -6%
private-kernel-tail 1.003s -3%
private-kernel-reset 6.684s 4%
private-kernel-inner 2.086s 6%

Copy link
Contributor

Execution Report

Program Execution Time %
sha256_regression 0.051s -4%
regression_4709 0.001s 0%
ram_blowup_regression 0.607s -2%
rollup-root 0.104s 0%
rollup-merge 0.006s 0%
rollup-block-root 36.600s 0%
rollup-block-merge 0.104s 0%
rollup-base-public 1.222s 2%
rollup-base-private 0.451s -1%
private-kernel-tail 0.019s 0%
private-kernel-reset 0.312s -1%
private-kernel-inner 0.067s 0%

Copy link
Contributor

Execution Memory Report

Program Peak Memory
keccak256 74.71M
workspace 123.95M
regression_4709 316.02M
ram_blowup_regression 512.62M
rollup-root 498.31M
rollup-merge 473.05M
rollup-block-root 1.22G
rollup-block-merge 498.33M
rollup-base-public 734.18M
rollup-base-private 590.51M
private-kernel-tail 180.91M
private-kernel-reset 245.52M
private-kernel-inner 208.92M

Copy link
Contributor

Compilation Memory Report

Program Peak Memory
keccak256 77.65M
workspace 123.93M
regression_4709 424.15M
ram_blowup_regression 1.46G
rollup-root 601.26M
rollup-merge 494.24M
rollup-block-root-single-tx 16.06G
rollup-block-root-empty 488.41M
rollup-block-root 16.07G
rollup-block-merge 601.26M
rollup-base-public 2.38G
rollup-base-private 1.14G
private-kernel-tail 207.46M
private-kernel-reset 584.49M
private-kernel-inner 294.68M

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

Successfully merging this pull request may close these issues.

1 participant