Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a5c1b5f

Browse files
author
AztecBot
committedJan 20, 2025
fix: don't always use an exclusive lock in nargo check (noir-lang/noir#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)
2 parents cde04e6 + f21b821 commit a5c1b5f

File tree

21 files changed

+625
-225
lines changed

21 files changed

+625
-225
lines changed
 

‎.noir-sync-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dd7084545dfd93a07599fc10676b6c8ec1e3d458
1+
bbdb937d44ddfbcd02a746dba9ad73ac704fcdd3

‎noir/noir-repo/.github/workflows/reports.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ jobs:
120120
121121
./gates_report_brillig.sh 9223372036854775807
122122
jq '.programs |= map(.package_name |= (. + "_inliner_max"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_max.json
123-
123+
124124
./gates_report_brillig.sh 0
125125
jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_zero.json
126-
126+
127127
./gates_report_brillig.sh -9223372036854775808
128128
jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_min.json
129129
@@ -176,14 +176,14 @@ jobs:
176176
- name: Generate Brillig execution report
177177
working-directory: ./test_programs
178178
run: |
179-
mkdir ./reports
180-
179+
mkdir ./reports
180+
181181
./gates_report_brillig_execution.sh 9223372036854775807
182182
jq '.programs |= map(.package_name |= (. + "_inliner_max"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_max.json
183183
184184
./gates_report_brillig_execution.sh 0
185185
jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_zero.json
186-
186+
187187
./gates_report_brillig_execution.sh -9223372036854775808
188188
jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_min.json
189189
@@ -296,15 +296,15 @@ jobs:
296296
run: |
297297
./execution_report.sh 0 1
298298
mv execution_report.json ../execution_report.json
299-
299+
300300
- name: Upload compilation report
301301
uses: actions/upload-artifact@v4
302302
with:
303303
name: in_progress_compilation_report
304304
path: compilation_report.json
305305
retention-days: 3
306306
overwrite: true
307-
307+
308308
- name: Upload execution report
309309
uses: actions/upload-artifact@v4
310310
with:
@@ -404,7 +404,7 @@ jobs:
404404
PACKAGE_NAME=$(basename $PACKAGE_NAME)
405405
mv ./test-repo/${{ matrix.project.path }}/execution_report.json ./execution_report_$PACKAGE_NAME.json
406406
echo "execution_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
407-
407+
408408
- name: Upload compilation report
409409
uses: actions/upload-artifact@v4
410410
with:
@@ -422,10 +422,10 @@ jobs:
422422
overwrite: true
423423

424424
upload_compilation_report:
425-
name: Upload compilation report
425+
name: Upload compilation report
426426
needs: [generate_compilation_and_execution_report, external_repo_compilation_and_execution_report]
427427
# We want this job to run even if one variation of the matrix in `external_repo_compilation_and_execution_report` fails
428-
if: always()
428+
if: always()
429429
runs-on: ubuntu-22.04
430430
permissions:
431431
pull-requests: write
@@ -595,10 +595,10 @@ jobs:
595595
overwrite: true
596596

597597
upload_compilation_memory_report:
598-
name: Upload compilation memory report
598+
name: Upload compilation memory report
599599
needs: [generate_memory_report, external_repo_memory_report]
600600
# We want this job to run even if one variation of the matrix in `external_repo_memory_report` fails
601-
if: always()
601+
if: always()
602602
runs-on: ubuntu-22.04
603603
permissions:
604604
pull-requests: write
@@ -665,10 +665,10 @@ jobs:
665665
max-items-in-chart: 50
666666

667667
upload_execution_memory_report:
668-
name: Upload execution memory report
668+
name: Upload execution memory report
669669
needs: [generate_memory_report, external_repo_memory_report]
670670
# We want this job to run even if one variation of the matrix in `external_repo_memory_report` fails
671-
if: always()
671+
if: always()
672672
runs-on: ubuntu-22.04
673673
permissions:
674674
pull-requests: write
@@ -736,10 +736,10 @@ jobs:
736736

737737

738738
upload_execution_report:
739-
name: Upload execution report
739+
name: Upload execution report
740740
needs: [generate_compilation_and_execution_report, external_repo_compilation_and_execution_report]
741741
# We want this job to run even if one variation of the matrix in `external_repo_compilation_and_execution_report` fails
742-
if: always()
742+
if: always()
743743
runs-on: ubuntu-22.04
744744
permissions:
745745
pull-requests: write

‎noir/noir-repo/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,7 @@ impl<'block, Registers: RegisterAllocator> BrilligBlock<'block, Registers> {
16241624

16251625
match value {
16261626
Value::Global(_) => {
1627-
unreachable!("Expected global value to be resolved to its inner value");
1627+
unreachable!("Expected global value to be resolve to its inner value");
16281628
}
16291629
Value::Param { .. } | Value::Instruction { .. } => {
16301630
// All block parameters and instruction results should have already been

‎noir/noir-repo/compiler/noirc_evaluator/src/ssa.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,19 @@ pub(crate) fn optimize_into_acir(
150150
/// Run all SSA passes.
151151
fn optimize_all(builder: SsaBuilder, options: &SsaEvaluatorOptions) -> Result<Ssa, RuntimeError> {
152152
Ok(builder
153-
.run_pass(Ssa::remove_unreachable_functions, "Removing Unreachable Functions")
153+
.run_pass(Ssa::remove_unreachable_functions, "Removing Unreachable Functions (1st)")
154154
.run_pass(Ssa::defunctionalize, "Defunctionalization")
155155
.run_pass(Ssa::remove_paired_rc, "Removing Paired rc_inc & rc_decs")
156+
.run_pass(
157+
|ssa| ssa.preprocess_functions(options.inliner_aggressiveness),
158+
"Preprocessing Functions",
159+
)
156160
.run_pass(|ssa| ssa.inline_functions(options.inliner_aggressiveness), "Inlining (1st)")
157161
// Run mem2reg with the CFG separated into blocks
158162
.run_pass(Ssa::mem2reg, "Mem2Reg (1st)")
159163
.run_pass(Ssa::simplify_cfg, "Simplifying (1st)")
160164
.run_pass(Ssa::as_slice_optimization, "`as_slice` optimization")
161-
.run_pass(Ssa::remove_unreachable_functions, "Removing Unreachable Functions")
165+
.run_pass(Ssa::remove_unreachable_functions, "Removing Unreachable Functions (2nd)")
162166
.try_run_pass(
163167
Ssa::evaluate_static_assert_and_assert_constant,
164168
"`static_assert` and `assert_constant`",
@@ -188,7 +192,7 @@ fn optimize_all(builder: SsaBuilder, options: &SsaEvaluatorOptions) -> Result<Ss
188192
.run_pass(Ssa::fold_constants_using_constraints, "Constraint Folding")
189193
.run_pass(Ssa::make_constrain_not_equal_instructions, "Adding constrain not equal")
190194
.run_pass(Ssa::dead_instruction_elimination, "Dead Instruction Elimination (1st)")
191-
.run_pass(Ssa::simplify_cfg, "Simplifying:")
195+
.run_pass(Ssa::simplify_cfg, "Simplifying (3rd):")
192196
.run_pass(Ssa::array_set_optimization, "Array Set Optimizations")
193197
.finish())
194198
}

‎noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/defunctionalize.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ fn create_apply_function(
287287
let mut function_builder = FunctionBuilder::new("apply".to_string(), id);
288288
function_builder.set_globals(globals);
289289

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

0 commit comments

Comments
 (0)