Repository navigation
xls/tools: Extract pass pipeline flags library - #5549
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_1028349989
branch
2 times, most recently
from
November 24, 2026 23:52
9b4c04d to
6d069b4
Compare
Move the nine optimization pass-pipeline `ABSL_FLAG` definitions and their
parsing/validation logic out of `opt_flags` into `//xls/tools:pass_pipeline_flags`
so other tools can share them without linking colliding flags (`--top`,
`--opt_level`, `--ir_dump_path`, `--delay_model`, `--area_model`):
- Flags moved: `--passes`, `--passes_proto`, `--passes_textproto`,
`--pipeline_proto`, `--pipeline_textproto`, `--skip_passes`,
`--passes_bisect_limit`, `--passes_bisect_limit_is_error`, and
`--debug_optimizations`.
- Exposes `GetPassPipelineFlags()` returning `PassPipelineFlagsResult`
(`{config, any_flags_set}`).
- Keeps `OptFlagsProto` field tags unchanged for backwards compatibility.
- Updates `opt_flags` to delegate pass-pipeline flag reading to
`GetPassPipelineFlags()`.
Also fixes bugs encountered during extraction:
- Handle explicit `--passes=` (parsed by Abseil as `std::nullopt` for
`std::optional<std::string>`) as an empty no-op pipeline rather than falling
back to the default pipeline.
- Fix `--pipeline__textproto` typo in the conflict error message.
- Drop redundant invariant-checker attachment before `ToProto()`.
- Mark `any_flags_set` when `--ram_rewrites_pb` is passed so combining it with
`--opt_options_proto` is rejected instead of silently overwritten.
- Fix stale pass short names in the `--passes` example (`arith_simp`,
`map_inlining`).
PiperOrigin-RevId: 1029419183
copybara-service
Bot
force-pushed
the
test_1028349989
branch
from
November 25, 2026 00:20
6d069b4 to
8652739
Compare
This branch was previously 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/tools: Extract pass pipeline flags library
Move the nine optimization pass-pipeline
ABSL_FLAGdefinitions and theirparsing/validation logic out of
opt_flagsinto//xls/tools:pass_pipeline_flagsso other tools can share them without linking colliding flags (
--top,--opt_level,--ir_dump_path,--delay_model,--area_model):--passes,--passes_proto,--passes_textproto,--pipeline_proto,--pipeline_textproto,--skip_passes,--passes_bisect_limit,--passes_bisect_limit_is_error, and--debug_optimizations.GetPassPipelineFlags()returningPassPipelineFlagsResult(
{config, any_flags_set}).OptFlagsProtofield tags unchanged for backwards compatibility.opt_flagsto delegate pass-pipeline flag reading toGetPassPipelineFlags().Also fixes bugs encountered during extraction:
--passes=(parsed by Abseil asstd::nulloptforstd::optional<std::string>) as an empty no-op pipeline rather than fallingback to the default pipeline.
--pipeline__textprototypo in the conflict error message.ToProto().any_flags_setwhen--ram_rewrites_pbis passed so combining it with--opt_options_protois rejected instead of silently overwritten.--passesexample (arith_simp,map_inlining).