-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swap-ir-impl starting point #4
base: feat-implement-ir
Are you sure you want to change the base?
Conversation
IsNode derive macro: support extra fields
@Soulthym I just realized that since this PR is in your fork, and not the 0xPolygonMiden repo, I can't leave review comments. Not sure if it's easier to open a PR stacked on 0xPolygonMiden/air-script#359 with these changes, or add me as a collaborator to this repo for reviews, but I'll have to wait for one or the other to provide my review feedback. Just let me know which! |
Hey @bitwalker, we just added you as a contributor to our fork. We hope that solves the issue. |
* derive Hash for SpannedMirValue * ir3: better node splitting, no macro, simpler api missimg builder pattern * replaced Link<Op> by Link<Owner> for Operations and Leaves * added IndexAccess Operand * renamed IndexAccess to Accessor re use parser's AccessType impl Hash for AccessType * fix call being copied instead of pointed to by get_children() * typesafe builder pattern for most ops. Misssing structured ops * type-safe Builder pattern for structured ops * MirGraph Builder editing * Add Leaves to Op enum * ir3: comment top level items * isolate Leaf, Op, Owner, Root * add converters to enums * added converters to structs renamed IndexAccess to Acccessor * Initial merge ir3 > update_passes * remove comments * Update mod.rs * Graph: implement public api * Swapped in helpers of passes/mod.rs * Node: all node types + converters * Full inlining with Node + cargo fmt * Remove Link for FoldOperator * Swap unrolling * Swap lowering Mir -> Air * Update visitor (with suboptimal get_children() herlper, to refactor) * Add MirType to Parameter * Update inlining to handle evaluators * most of translated adapted * add type support for Parameter in translate * in build_statement, handle Owner::None (integrity or boundary constraint) --------- Co-authored-by: Thybault Alabarbe <[email protected]>
Update passes
Hey @bitwalker, We have some tests passing on the end2end pipeline, missing the lowering pass ones. Missing features:
Based on the mir crate tests, here is what is currently missing/broken:
Edit as of 13 dec.: all current tests fixed by relaxing constraints for iterables Once the API is stabilized, we will refactor the boilerplate. |
Hey @bitwalker, here is a recap of the work left to do. The latest version is available on a new branch of this fork: https://github.com/massalabs/air-script/tree/fix-ir-translate Currently, the tests in the mir package ( There are currently 3 identified issues left to work on, plus the features not marked as resolved above. Parameter/argument unpacking:Parameter unpacking for
Mutability is not really handled through enums and conversions.Mutating one occurence does not mutate others because conversion is done through cloning the underlying structure and wrapping that in a new Link.
enum Op {
Add(Add),
...
} becomes enum Op {
Add(Link<Add>)
...
}
Rework passesAfter the previous is done, we will be able to work on:
cleanup the codebase
|
Define missing operation types: now under
ir2/nodes/...
VariableParameterImplement Spanned trait for nodes:
Helper traits are available (IsNode, NotNode, IsGraph, NotGraph, IsLeaf, NotLeaf)
And in reverse.
Match
graph/mod.rs
api, now underir2/graph.rs
- [ ]insert_op_*
->new_*().add_child()
orAdd::new(parent, lhs, rhs)
Redefine visitor pattern with the new structure
Redefine remaining APIs referencing
NodeIndex
, replace them withLink<NodeType>
Convert passes to use ir2 and updated visitor pattern
Add validation to the builder pattern
Maybe isolate builder pattern into its own trait