[Synth] Add declarative cut rewrite pattern and yield op#10565
Open
okekayode wants to merge 1 commit into
Open
[Synth] Add declarative cut rewrite pattern and yield op#10565okekayode wants to merge 1 commit into
okekayode wants to merge 1 commit into
Conversation
uenoku
reviewed
May 31, 2026
5ba04fa to
59ffecd
Compare
uenoku
reviewed
May 31, 2026
uenoku
reviewed
May 31, 2026
59ffecd to
aee47a9
Compare
uenoku
reviewed
May 31, 2026
aee47a9 to
2318e6e
Compare
uenoku
reviewed
May 31, 2026
|
|
||
| // CHECK-LABEL: synth.cut_rewrite_pattern | ||
| // CHECK-SAME: (%{{.*}}: i1, %{{.*}}: i1, %{{.*}}: i1) -> i1 | ||
| synth.cut_rewrite_pattern (%a: i1, %b: i1, %c: i1) -> i1 attributes {cost = #synth.mapping_cost<area = 1.0 : f64, arcs = [], input_caps = {}>} { |
Member
There was a problem hiding this comment.
We should also improve changing mapping cost's attribute representation:
arcscurrently store input/output names but this op doesn't have input/output names, so I think we should drop names in the attributes.- This is MLIR textual representation for
mapping_costbut input_caps should be omitted when empty.
Contributor
Author
There was a problem hiding this comment.
Okay, do we prefer to add a custom print/parser for MappingCostAttr to omit empty input_caps, and alter synth.linear_timing_arc to accept nameless/pos args for this op?
I do think also switching to OptionalAttr on the MappingCostAttr args may be cleaner, but this would require more verifications of null/absences in TechMapper.cpp.
WDYT?
uenoku
reviewed
May 31, 2026
2318e6e to
030d0a0
Compare
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.
Concerns #10485
We introduce the declarative operation
synth.cut_rewrite_patternand also the terminator operationsynth.yield.synth.cut_rewrite_patterndenotes cut rewrite patterns fori1input and result types as function-shaped regions. We also implement a custom printer and parser with attribute support forsynth.mapping_cost.In this PR we only introduce the IR representation; wiring this into consumers, for example
TechMapper.cpp, can be added later.