Skip to content

Commit

Permalink
fix: don't always use an exclusive lock in nargo check (noir-lang/n…
Browse files Browse the repository at this point in the history
…oir#7120)

feat(ssa): Pass to preprocess functions (noir-lang/noir#7072)
chore: Formatting issues / minor errors in the docs (noir-lang/noir#7105)
fix: defunctionalize pass on the caller runtime to apply (noir-lang/noir#7100)
feat: Parser and formatter support for `enum`s (noir-lang/noir#7110)
feat(brillig): SSA globals code gen (noir-lang/noir#7021)
feat: `loop` keyword in runtime and comptime code (noir-lang/noir#7096)
chore: Add benchmarking dashboard (noir-lang/noir#7068)
feat(experimental): try to infer lambda argument types inside calls (noir-lang/noir#7088)
feat(ssa): Add flag to DIE pass to be able to keep `store` instructions (noir-lang/noir#7106)
chore: Cookbook Onboard integration (noir-lang/noir#7044)
chore: lock to ubuntu 22.04 (noir-lang/noir#7098)
fix: Remove unused brillig functions (noir-lang/noir#7102)
chore(ssa): Use correct prefix when printing array values in global space (noir-lang/noir#7095)
  • Loading branch information
AztecBot committed Jan 20, 2025
2 parents cde04e6 + f21b821 commit a5c1b5f
Show file tree
Hide file tree
Showing 21 changed files with 625 additions and 225 deletions.
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dd7084545dfd93a07599fc10676b6c8ec1e3d458
bbdb937d44ddfbcd02a746dba9ad73ac704fcdd3
32 changes: 16 additions & 16 deletions noir/noir-repo/.github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ jobs:
./gates_report_brillig.sh 9223372036854775807
jq '.programs |= map(.package_name |= (. + "_inliner_max"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_max.json
./gates_report_brillig.sh 0
jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_zero.json
./gates_report_brillig.sh -9223372036854775808
jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_min.json
Expand Down Expand Up @@ -176,14 +176,14 @@ jobs:
- name: Generate Brillig execution report
working-directory: ./test_programs
run: |
mkdir ./reports
mkdir ./reports
./gates_report_brillig_execution.sh 9223372036854775807
jq '.programs |= map(.package_name |= (. + "_inliner_max"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_max.json
./gates_report_brillig_execution.sh 0
jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_zero.json
./gates_report_brillig_execution.sh -9223372036854775808
jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_min.json
Expand Down Expand Up @@ -296,15 +296,15 @@ jobs:
run: |
./execution_report.sh 0 1
mv execution_report.json ../execution_report.json
- name: Upload compilation report
uses: actions/upload-artifact@v4
with:
name: in_progress_compilation_report
path: compilation_report.json
retention-days: 3
overwrite: true

- name: Upload execution report
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -404,7 +404,7 @@ jobs:
PACKAGE_NAME=$(basename $PACKAGE_NAME)
mv ./test-repo/${{ matrix.project.path }}/execution_report.json ./execution_report_$PACKAGE_NAME.json
echo "execution_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
- name: Upload compilation report
uses: actions/upload-artifact@v4
with:
Expand All @@ -422,10 +422,10 @@ jobs:
overwrite: true

upload_compilation_report:
name: Upload compilation report
name: Upload compilation report
needs: [generate_compilation_and_execution_report, external_repo_compilation_and_execution_report]
# We want this job to run even if one variation of the matrix in `external_repo_compilation_and_execution_report` fails
if: always()
if: always()
runs-on: ubuntu-22.04
permissions:
pull-requests: write
Expand Down Expand Up @@ -595,10 +595,10 @@ jobs:
overwrite: true

upload_compilation_memory_report:
name: Upload compilation memory report
name: Upload compilation memory report
needs: [generate_memory_report, external_repo_memory_report]
# We want this job to run even if one variation of the matrix in `external_repo_memory_report` fails
if: always()
if: always()
runs-on: ubuntu-22.04
permissions:
pull-requests: write
Expand Down Expand Up @@ -665,10 +665,10 @@ jobs:
max-items-in-chart: 50

upload_execution_memory_report:
name: Upload execution memory report
name: Upload execution memory report
needs: [generate_memory_report, external_repo_memory_report]
# We want this job to run even if one variation of the matrix in `external_repo_memory_report` fails
if: always()
if: always()
runs-on: ubuntu-22.04
permissions:
pull-requests: write
Expand Down Expand Up @@ -736,10 +736,10 @@ jobs:


upload_execution_report:
name: Upload execution report
name: Upload execution report
needs: [generate_compilation_and_execution_report, external_repo_compilation_and_execution_report]
# We want this job to run even if one variation of the matrix in `external_repo_compilation_and_execution_report` fails
if: always()
if: always()
runs-on: ubuntu-22.04
permissions:
pull-requests: write
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ impl<'block, Registers: RegisterAllocator> BrilligBlock<'block, Registers> {

match value {
Value::Global(_) => {
unreachable!("Expected global value to be resolved to its inner value");
unreachable!("Expected global value to be resolve to its inner value");
}
Value::Param { .. } | Value::Instruction { .. } => {
// All block parameters and instruction results should have already been
Expand Down
10 changes: 7 additions & 3 deletions noir/noir-repo/compiler/noirc_evaluator/src/ssa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,19 @@ pub(crate) fn optimize_into_acir(
/// Run all SSA passes.
fn optimize_all(builder: SsaBuilder, options: &SsaEvaluatorOptions) -> Result<Ssa, RuntimeError> {
Ok(builder
.run_pass(Ssa::remove_unreachable_functions, "Removing Unreachable Functions")
.run_pass(Ssa::remove_unreachable_functions, "Removing Unreachable Functions (1st)")
.run_pass(Ssa::defunctionalize, "Defunctionalization")
.run_pass(Ssa::remove_paired_rc, "Removing Paired rc_inc & rc_decs")
.run_pass(
|ssa| ssa.preprocess_functions(options.inliner_aggressiveness),
"Preprocessing Functions",
)
.run_pass(|ssa| ssa.inline_functions(options.inliner_aggressiveness), "Inlining (1st)")
// Run mem2reg with the CFG separated into blocks
.run_pass(Ssa::mem2reg, "Mem2Reg (1st)")
.run_pass(Ssa::simplify_cfg, "Simplifying (1st)")
.run_pass(Ssa::as_slice_optimization, "`as_slice` optimization")
.run_pass(Ssa::remove_unreachable_functions, "Removing Unreachable Functions")
.run_pass(Ssa::remove_unreachable_functions, "Removing Unreachable Functions (2nd)")
.try_run_pass(
Ssa::evaluate_static_assert_and_assert_constant,
"`static_assert` and `assert_constant`",
Expand Down Expand Up @@ -188,7 +192,7 @@ fn optimize_all(builder: SsaBuilder, options: &SsaEvaluatorOptions) -> Result<Ss
.run_pass(Ssa::fold_constants_using_constraints, "Constraint Folding")
.run_pass(Ssa::make_constrain_not_equal_instructions, "Adding constrain not equal")
.run_pass(Ssa::dead_instruction_elimination, "Dead Instruction Elimination (1st)")
.run_pass(Ssa::simplify_cfg, "Simplifying:")
.run_pass(Ssa::simplify_cfg, "Simplifying (3rd):")
.run_pass(Ssa::array_set_optimization, "Array Set Optimizations")
.finish())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ fn create_apply_function(
let mut function_builder = FunctionBuilder::new("apply".to_string(), id);
function_builder.set_globals(globals);

// We want to push for apply functions to be inlined more aggressively.
// We want to push for apply functions to be inlined more aggressively;
// they are expected to be optimized away by constants visible at the call site.
let runtime = match caller_runtime {
RuntimeType::Acir(_) => RuntimeType::Acir(InlineType::InlineAlways),
RuntimeType::Brillig(_) => RuntimeType::Brillig(InlineType::InlineAlways),
Expand Down
Loading

0 comments on commit a5c1b5f

Please sign in to comment.