-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Use places in BB signatures for Hugr generation (#342)
Fixes #337. The fix for the linearity checker is easy: When checking assignments, only complain if a *local* unused linear variable is shadowed. However, correctly lowering the program in #337 to Hugr requires some additional changes to Hugr codegen. Namely, we need to consider if a BB uses a *whole* struct `s` or only some of its fields. In the latter case, we should only feed those used values into the BB. This requires specifying the signature of BBs in the form of `Place`s rather than `Variable`s. Concretely, this PR does the following: * Make `Signature` generic over the representation of program variables so it can capture both `Variable` and `Place` * Similarly, make `CheckedBB` and `CheckedCFG` generic * During checking, we first construct a `CheckedCFG[Variable]` which then gets turned into a `CheckedCFG[Place]` during linearity checking * Add a test case
- Loading branch information
Showing
9 changed files
with
124 additions
and
56 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
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.