From 5439bcf52c1462a2a520ca342ca8dcd1abe9cd13 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Thu, 16 Oct 2025 11:50:07 +0000 Subject: [PATCH] chore: document precondition to unrolling SSA pass --- compiler/noirc_evaluator/src/ssa/opt/unrolling.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs b/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs index 3bc48e8483d..f4faffcb7ae 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs @@ -33,9 +33,9 @@ //! used as loop bounds, into a form which loop unrolling may better identify. //! //! Conditions: -//! - Pre-conditions: No explicit pre-conditions strictly required to run this pass but in -//! practice since other passes affect this passes ability to unroll loops, some passes such as -//! inlining and mem2reg are required before running this on arbitrary noir code. +//! - Pre-condition: All loop headers have a single induction variable. +//! - Pre-condition: The SSA must be optimized to a point at which loop bounds are known. +//! Some passes such as inlining and mem2reg are de-facto required before running this pass on arbitrary noir code. //! - Post-condition (ACIR-only): All loops in ACIR functions should be unrolled when this pass is //! completed successfully. Any loops that are not unrolled (e.g. because of a mutable variable //! used in the loop condition whose value is unknown) will result in an error.