-
Notifications
You must be signed in to change notification settings - Fork 54
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
Don't fold lets with fail
, trace
or >->
in the body
#2973
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.
I'd prefer if we had a function isDebugOp : BuiltinOp -> Bool
with an explicit pattern match instead of an ad hoc list
where | ||
isDebugOp :: Node -> Bool | ||
isDebugOp = \case | ||
NBlt (BuiltinApp {..}) -> _builtinAppOp `elem` [OpTrace, OpFail, OpSeq] |
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.
NBlt (BuiltinApp {..}) -> _builtinAppOp `elem` [OpTrace, OpFail, OpSeq] | |
NBlt BuiltinApp {..} -> _builtinAppOp `elem` [OpTrace, OpFail, OpSeq] |
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.
done
After * #2973 let-folding stopped being linear in the size of the input program. All transformations should be linear whenever possible. This PR makes let-folding linear again.
This is to avoid optimizing e.g.
into
which is annoying when debugging.