[Synth] Make FunctionalReduction runnable on any op#10230
Open
SmitVaishnav wants to merge 2 commits intollvm:mainfrom
Open
[Synth] Make FunctionalReduction runnable on any op#10230SmitVaishnav wants to merge 2 commits intollvm:mainfrom
SmitVaishnav wants to merge 2 commits intollvm:mainfrom
Conversation
Remove the `hw::HWModuleOp` anchor from the MaximumAndCover pass so it can be inserted into pipelines operating at any level (e.g. mlir::ModuleOp). No code change is needed since applyPatternsGreedily already traverses nested ops generically. Add a test that runs the pass on a func.func to verify it works on non-hw ops. Part of llvm#10133.
uenoku
reviewed
Apr 15, 2026
Remove the `hw::HWModuleOp` anchor from the FunctionalReduction pass so it can be inserted into pipelines operating at any level. The FunctionalReductionSolver is updated to accept any Operation* instead of hw::HWModuleOp. collectValues() now iterates the direct regions/blocks of the given op for primary inputs, and additionally scans for any i1 operands of simulatable ops that are defined outside the op's scope, treating them as unknown primary inputs. This ensures correct simulation regardless of what op the pass is anchored to. Add a func.func test to verify the pass works on non-hw ops. Part of llvm#10133.
d1b29f9 to
c4c8210
Compare
Contributor
Author
|
hey @uenoku lets connect on linkedin! |
uenoku
reviewed
Apr 16, 2026
| class FunctionalReductionSolver { | ||
| public: | ||
| FunctionalReductionSolver(hw::HWModuleOp module, unsigned numPatterns, | ||
| FunctionalReductionSolver(Operation *module, unsigned numPatterns, |
Member
There was a problem hiding this comment.
Can you change this to pass Block* block instead of Operaton* module, since it's very tedious to run this transformation across different blocks.
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.
Remove the
hw::HWModuleOpanchor from the FunctionalReduction pass so it can be inserted into pipelines operating at any level.The solver is updated to accept any
Operation*.collectValues()iterates direct regions/blocks for primary inputs, and scans for any i1 operands defined outside the op's scope, treating them as unknown primary inputs.Add a
func.functest to verify the pass works on non-hw ops.Part of #10133.