Skip to content

xls/passes: Add equivalence optimization pass groups - #5535

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1026770876
Nov 24, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1026770876

Conversation

@copybara-service

Copy link
Copy Markdown

xls/passes: Add equivalence optimization pass groups

Standard XLS hardware optimization pipelines include QoR transforms and O3
splitting that bloat SMT formulas or disrupt cross-design structure during
equivalence checking. Define four named compound pass groups capped at opt
level 2 (cap_opt_level: 2) so equivalence and formal property tools can
simplify IR before invoking SMT solvers:

  • equiv_simp: fixed-point scalar and array simplification omitting QoR
    transforms (select_simp, arith_simp, reassociation, concat_simp,
    table_switch) and O3 splitting; safe on functions and symbolic-state procs
    when cached proc state info is not populated.
  • optimize_for_equivalence_proc: pre-unroll proc optimization for
    reset-state equivalence checking (flattening, narrowing, and eliminating
    proc state elements interleaved with equiv_simp). Not intended for
    include_state=true or symbolic initial state checks.
  • optimize_for_equivalence: function and unrolled-proc optimization
    (equiv_simp, narrow(Range), cond_spec(noBdd), bdd_simp(2),
    bdd_cse, basic_simp, useless_assert_remove) without mutating proc
    state elements or requiring OptimizationPassOptions delay/area estimators.
    Note that narrow(Range) assumes reset initial_value() semantics if run
    directly on an un-unrolled proc (safe on functions and post-unroll functions
    including include_state=true).
  • optimize_for_equivalence_miter: post-join fixed-point simplification for
    combined equivalence miters, running syntactic cse before bdd_simp(2)
    and bdd_cse so identical subgraphs across halves share BDD variables.

Because bdd_cse calls GetStandardDelayEstimator(), binaries invoking
optimize_for_equivalence or optimize_for_equivalence_miter must link a
delay model plugin (//xls/estimators/delay_model/models).

Standard XLS hardware optimization pipelines include QoR transforms and O3
splitting that bloat SMT formulas or disrupt cross-design structure during
equivalence checking. Define four named compound pass groups capped at opt
level 2 (`cap_opt_level: 2`) so equivalence and formal property tools can
simplify IR before invoking SMT solvers:

- `equiv_simp`: fixed-point scalar and array simplification omitting QoR
  transforms (`select_simp`, `arith_simp`, `reassociation`, `concat_simp`,
  `table_switch`) and O3 splitting; safe on functions and symbolic-state procs
  when cached proc state info is not populated.
- `optimize_for_equivalence_proc`: pre-unroll proc optimization for
  reset-state equivalence checking (flattening, narrowing, and eliminating
  proc state elements interleaved with `equiv_simp`). Not intended for
  `include_state=true` or symbolic initial state checks.
- `optimize_for_equivalence`: function and unrolled-proc optimization
  (`equiv_simp`, `narrow(Range)`, `cond_spec(noBdd)`, `bdd_simp(2)`,
  `bdd_cse`, `basic_simp`, `useless_assert_remove`) without mutating proc
  state elements or requiring `OptimizationPassOptions` delay/area estimators.
  Note that `narrow(Range)` assumes reset `initial_value()` semantics if run
  directly on an un-unrolled proc (safe on functions and post-unroll functions
  including `include_state=true`).
- `optimize_for_equivalence_miter`: post-join fixed-point simplification for
  combined equivalence miters, running syntactic `cse` before `bdd_simp(2)`
  and `bdd_cse` so identical subgraphs across halves share BDD variables.

Because `bdd_cse` calls `GetStandardDelayEstimator()`, binaries invoking
`optimize_for_equivalence` or `optimize_for_equivalence_miter` must link a
delay model plugin (`//xls/estimators/delay_model/models`).

PiperOrigin-RevId: 1029050106
@copybara-service
copybara-service Bot merged commit ca343d6 into main Nov 24, 2026
5 checks passed
@copybara-service
copybara-service Bot deleted the test_1026770876 branch November 24, 2026 15:53

This branch was successfully deployed

1 active deployment
github-pages — ca343d66 Deployed Nov 24, 2026 by copybara-service[bot] via deploy #14926
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.

1 participant