Skip to content

[Synth] Add declarative cut rewrite pattern and yield op#10565

Merged
uenoku merged 5 commits into
llvm:mainfrom
okekayode:dev/add-op-for-declarative-cut-rewrite
Jun 13, 2026
Merged

[Synth] Add declarative cut rewrite pattern and yield op#10565
uenoku merged 5 commits into
llvm:mainfrom
okekayode:dev/add-op-for-declarative-cut-rewrite

Conversation

@okekayode

@okekayode okekayode commented May 31, 2026

Copy link
Copy Markdown
Contributor

Concerns #10485

We introduce the declarative operation synth.cut_rewrite_pattern and also the terminator operation synth.yield.

synth.cut_rewrite_pattern denotes cut rewrite patterns for i1 input and result types as function-shaped regions. We also implement a custom printer and parser with attribute support for synth.mapping_cost.

In this PR we only introduce the IR representation; wiring this into consumers, for example TechMapper.cpp, can be added later.

@okekayode okekayode changed the title [Synth] Add an operation for declarative Cut rewrite pattern [Synth] Add declarative cut rewrite pattern and yield op May 31, 2026
@circt-bot

circt-bot Bot commented May 31, 2026

Copy link
Copy Markdown

Results of circt-tests run for 833947f compared to results for 7aa41cc: no change to test results.

Comment thread include/circt/Dialect/Synth/SynthOps.td Outdated
@okekayode okekayode force-pushed the dev/add-op-for-declarative-cut-rewrite branch 2 times, most recently from 5ba04fa to 59ffecd Compare May 31, 2026 05:56
Comment thread lib/Dialect/Synth/SynthOps.cpp Outdated
Comment thread lib/Dialect/Synth/SynthOps.cpp Outdated
@okekayode okekayode force-pushed the dev/add-op-for-declarative-cut-rewrite branch from 59ffecd to aee47a9 Compare May 31, 2026 06:15
@circt-bot

circt-bot Bot commented May 31, 2026

Copy link
Copy Markdown

Results of circt-tests run for aee47a9 compared to results for 7aa41cc: no change to test results.

Comment thread lib/Dialect/Synth/SynthOps.cpp Outdated
Comment thread lib/Dialect/Synth/SynthOps.cpp Outdated
Comment thread lib/Dialect/Synth/SynthOps.cpp Outdated
@okekayode okekayode force-pushed the dev/add-op-for-declarative-cut-rewrite branch from aee47a9 to 2318e6e Compare May 31, 2026 07:51
@circt-bot

circt-bot Bot commented May 31, 2026

Copy link
Copy Markdown

Results of circt-tests run for 2318e6e compared to results for 7aa41cc: no change to test results.

Comment thread test/Dialect/Synth/round-trip.mlir Outdated
Comment thread lib/Dialect/Synth/SynthOps.cpp Outdated

@uenoku uenoku left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@okekayode okekayode force-pushed the dev/add-op-for-declarative-cut-rewrite branch from 2318e6e to 030d0a0 Compare May 31, 2026 19:12
@circt-bot

circt-bot Bot commented May 31, 2026

Copy link
Copy Markdown

Results of circt-tests run for 030d0a0 compared to results for 7aa41cc: no change to test results.

@okekayode okekayode force-pushed the dev/add-op-for-declarative-cut-rewrite branch from 030d0a0 to 8e7d483 Compare June 2, 2026 18:07
Comment thread lib/Dialect/Synth/SynthOps.cpp Outdated
@circt-bot

circt-bot Bot commented Jun 2, 2026

Copy link
Copy Markdown

Results of circt-tests run for 8e7d483 compared to results for 7aa41cc: no change to test results.

@okekayode okekayode force-pushed the dev/add-op-for-declarative-cut-rewrite branch from 08f5c93 to a4a11d2 Compare June 2, 2026 22:22
@circt-bot

circt-bot Bot commented Jun 2, 2026

Copy link
Copy Markdown

Results of circt-tests run for a4a11d2 compared to results for 7aa41cc: no change to test results.

@circt-bot

circt-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown

Results of circt-tests run for 62d70f5 compared to results for 7aa41cc: no change to test results.

@okekayode

Copy link
Copy Markdown
Contributor Author

@uenoku I reverted the new positional timing arc attribute and added a TODO for the MappingCostAttr long-term representation, so cut_rewrite_pattern is no longer rejects arcs like before in my previous commit.

Moreover, I'd like to do a follow-up PR to move MappingCostAttr towards the nameless delay representation right after, where it is something like this: #synth.mapping_cost<area = 1.0 : f64, delays = [[1, 0], [2, 0]]> where each row concerns to an input position and stores the instrinsic, sensitivity for a single cut-pattern result. Then I'll wire it in.

LMK if that sounds good and I’ll open an issue for it after this PR is sorted. Thanks.

@circt-bot

circt-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

Results of circt-tests run for 472b8b3 compared to results for 7aa41cc:

sv-tests

Changes in emitted diagnostics:

  • +55 total change
  • +22 error: unsupported construct in ClassType members: ConstraintBlock
  • +7 error: identifier 'analysis_txn' used before its declaration
  • +6 error: no member named 'sprint' in 'm_uvm_printer_knobs'
  • +3 error: parentheses are required when invoking function 'get_status'
  • +3 error: value of type 'T' (aka 'uvm_sequence_base') cannot be assigned to type 'simple_seq'
  • +3 error: virtual method 'sample' is 'public' but declared 'protected' in superclass method
  • +2 error: time scale declaration must come before all other items in scope
  • -1 error: unknown module 'BUFGCE'
  • +1 error: unknown macro or compiler directive '`uvm_sequence_utils'
  • +1 error: unknown macro or compiler directive '`uvm_sequencer_utils'
  • +1 error: unknown module 'pss'
  • +1 error: unknown module 'pss_wrapper'
  • +1 error: unknown module 'spi_clgen'
  • +1 error: unknown module 'spi_shift'
  • +1 error: unsupported format specifier `%c`
  • +1 error: use of undeclared identifier 'CONTROL'
  • +1 error: use of undeclared identifier 'count'
  • +1 error: value of type 'T' (aka 'uvm_sequencer') cannot be assigned to type 'simple_sequencer'

@uenoku uenoku self-requested a review June 13, 2026 07:21
"::mlir::FloatAttr":$area,
"::mlir::ArrayAttr":$arcs,
"::mlir::DictionaryAttr":$inputCaps
OptionalParameter<"::mlir::ArrayAttr">:$arcs,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you follow up on this? I think we want to make delay/arc somewhat required for each patterns, even when they want to use depth driven by BooleanLogicOpInterface.

@uenoku uenoku merged commit 53a594f into llvm:main Jun 13, 2026
6 checks passed
@uenoku

uenoku commented Jun 13, 2026

Copy link
Copy Markdown
Member

Sorry for the delayed review, thank you!

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.

2 participants