-
Notifications
You must be signed in to change notification settings - Fork 463
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
[PIR] Don't generate 'fixBy' if you don't need to #5954
[PIR] Don't generate 'fixBy' if you don't need to #5954
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I can't see a change in a golden file that demonstrates how fixBy
was generated before the change and how its not generated after.
Do you mind adding a golden file demonstrating the desired effect?
…to effectfully/plutus-ir/do-not-generate-fixBy-if-you-do-not-need-to
Well, I can't do that in this PR, because this PR removes generation of |
…to effectfully/plutus-ir/do-not-generate-fixBy-if-you-do-not-need-to
@@ -79,6 +79,51 @@ applyFun = runQuote $ do | |||
. lamAbs () x (TyVar () a) | |||
$ apply () (var () f) (var () x) | |||
|
|||
{- Note [Recursion combinators] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I confused branches and added the Note in this one rather than the strictify-fix
one. Doesn't matter much, I guess.
fixBy | ||
(all | ||
F | ||
(fun (type) (type)) | ||
(fun | ||
(fun (all Q (type) (fun [ F Q ] Q)) (all Q (type) (fun [ F Q ] Q))) | ||
(fun | ||
(all Q (type) (fun [ F Q ] [ F Q ])) (all Q (type) (fun [ F Q ] Q)) | ||
) | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixBy
is gone.
Currently we generate
fixBy
(a combinator used for compiling mutual recursion) whenever we have any recursive functions in the PIR program, but most of those only need the basic Z combinator and no fancyfixBy
stuff, so generating the latter is pointless and can be very confusing if you want to look at the output of the compiler without optimizations (in particular, DCE) turned on. Not generatingfixBy
if you don't need to is trivial, so let's do that.