-
Notifications
You must be signed in to change notification settings - Fork 18
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
Implement an app node #115
Conversation
used in only a single place in world.cpp, for a folding op hoist_enters also carries out
This is a _massive_ commit that probably breaks many things. It does compile, and subsequent commits will identify problems and refactor yet more things thanks to this change.
Regarding the changes to This change works and passes Impala/Artic tests + rodent. I'm looking into renaming |
I think the general consensus was that this |
Update: f220175 fixes building With the rework of the replace mechanism, my last gripe with this branch is gone. It also opens up the opportunity of making structural nodes truly immutable by simply creating new ones and leaving the old ones alone, I have written code for this but currently simply mutating them in-place is more efficient (though the CSE hash map should probably get updated to reflect it without needing to re-import). There is also an issue in I have another branch for the renaming of |
@leissa @richardmembarth Can we get this merged this week ? |
|
|
As far as I'm concerned this branch is done and should be merged, any future work should happen in a new branch and we should merge this to allow syncing up with the other changes |
I'll take care of merging the frontend changes now |
This work in progress branch splits the
Continuation
class up into a head (the continuation class) and a body (a new App node), and also puts the filter out for good measure.big picture changes
args
andcallee
fromContinuation
App
primop that now holds those things, app.ops := (callee, arg0, arg1, arg2, ...)This breaks a fairly old truth in Thorin, which is that continuations use other continuations in their ops. In many places this means either looking for an App in the uses, or going through the body() of a continuation to get the callee/args. A new method,
Continuation::has_body()
has been added and is used throughout to check or assert (respectively) for the presence of a body. In the other direction, you can query for the continuation__s__ that use an app as their body, note the plural here, sinceApp
nodes are primops, they can and do get reused occasionallyThis branch as it stands has been currently successfully tested with stincilla and rodent, but will require more thorough testing before merging
smaller scale changes
App
node is now responsible for folding jumpsApp
node is not mutable, instead of mutating a modified version is created and wereplace
the original by it.Continuation::verify
now prevents a non-empty filter from being attached to a continuation with no bodyApp::verify
checks the types of the arguments directly instead of relying onarg_fn_type
andcallee_fn_type
.Param
ops, it is no longer necessary to treat cont params in a special way inscope.cpp
Filter
is also not mutablereplace()
has been renamed toreplace_uses()
and thesubstitute_
/Tracker
mechanism has been removedPrimOp
class is goneIssues
replace() seems to have dodgy discipline, you cannot replace an already replaced node but those "dead" nodes annoyingly stick aroundreworked to be sanerWhy isnecessary to fold as we perform PEeta_conversion
doing inlining whennum_uses
is 1, but also inpartial_evaluation::CondEval::eval
? Isn't it redundant ?Call
is now redundant and can be refactored outthe code can be further simplified/cleaned up nowfurther reworks left for another branch