-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CfToHandshake] Structural redesign of the pass
The `CfToHandshake` conversion pass has always (I think) been slightly weird in its implementation, sequentially triggering conversion patterns to progressively lower a `func::FuncOp` into a `handshake::FuncOp` in a way that I am not sure was strictly legal and safe with respect to MLIR's conversion framework invariants. Sometimes, the pass would also non-deterministically crash because of a mysterious dialect/operation registration error, which may have been due to this peculiar design. This completely redesigns the pass so that the bulk of the conversion process happens in a single conversion pattern, with every IR change going through the conversion pattern rewriter. Some piphole conversions still happen in seperate patterns that can only be triggered after the bulk conversion has happened. While the outcome of the pass doesn't change (modulo cosmetic things like the removal of useless merge-like operations in the entry block), the pass's structure changes significantly. Gone is the `HandshakeLowering` data-structure along with its accompanying partial conversion pattern and target; it is largely replaced with the exported `LowerFuncToHandshake` conversion pattern. The latter exposes all of its "partial internal conversion steps" as virtual methods to allow future users to reuse parts of its implementation when possible while forgoing the rest. The `handshake::MergeLikeOpInterface` gains an additional method to query for the data result of its attached operation. This makes querying this result more reliable from client code, for example this conversion pass.
- Loading branch information
1 parent
ebbb6b7
commit 582684a
Showing
6 changed files
with
722 additions
and
772 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.