Repository navigation
xls/passes: Add equivalence optimization pass groups - #5535
Merged
Merged
Conversation
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
Bot
force-pushed
the
test_1026770876
branch
from
November 24, 2026 15:53
4b11945 to
ca343d6
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 cansimplify IR before invoking SMT solvers:
equiv_simp: fixed-point scalar and array simplification omitting QoRtransforms (
select_simp,arith_simp,reassociation,concat_simp,table_switch) and O3 splitting; safe on functions and symbolic-state procswhen cached proc state info is not populated.
optimize_for_equivalence_proc: pre-unroll proc optimization forreset-state equivalence checking (flattening, narrowing, and eliminating
proc state elements interleaved with
equiv_simp). Not intended forinclude_state=trueor 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 procstate elements or requiring
OptimizationPassOptionsdelay/area estimators.Note that
narrow(Range)assumes resetinitial_value()semantics if rundirectly 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 forcombined equivalence miters, running syntactic
csebeforebdd_simp(2)and
bdd_cseso identical subgraphs across halves share BDD variables.Because
bdd_csecallsGetStandardDelayEstimator(), binaries invokingoptimize_for_equivalenceoroptimize_for_equivalence_mitermust link adelay model plugin (
//xls/estimators/delay_model/models).