-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Moore] Clean up struct ops and add missing tests
Rework the Moore dialect operations that manipulate struct values. These are intended to operate on `StructType` and `UnpackedStructType` values directly, but were defined in ODS as operating on references to structs. This was likely a hold-over from early development where we were still figuring out the distinction between ref types and value types in SV. This commit adjusts the struct ops such that they actually operate on struct values instead of references to structs. It also moves more operand constraints into ODS and simplifies the op verifiers by factoring out some common code into helper functions. Enhance the `struct_inject` canonicalizer to also consider `struct_create` operations as part of the inject chain. This allows an initial `struct_create` that is modified by a subsequent inject to be canonicalized into a new `struct_create` with updated values. Add missing basic and error tests for the struct-related ops, and simplify the variable destructuring test by removing unrelated operations. Also fixes an issue in variable op destructuring where a variable with initial value would have its initial value discarded during destructuring. Initial values now prevent destructuring. Alternatively, we may choose to insert appropriate `struct_extract` ops to destructure the initial value in the future.
- Loading branch information
1 parent
e02c015
commit 619cd44
Showing
9 changed files
with
384 additions
and
454 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.