Skip to content
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

Extend egglog to support richer cost functions #366

Open
oflatt opened this issue Feb 19, 2024 · 1 comment
Open

Extend egglog to support richer cost functions #366

oflatt opened this issue Feb 19, 2024 · 1 comment
Assignees

Comments

@oflatt
Copy link
Member

oflatt commented Feb 19, 2024

We need richer cost functions for extraction in eggcc.
For example, assume nodes should not take the context into account for the cost.
Loops should multiply the cost of children somehow.

This is a difficult change. Perhaps we can make something like this work?

(function DoWhile (Expr Expr) Expr :cost (+ c1 (* c2 5)))

We could also have an analysis that figures out how many times a loop iterates and use it in the cost function:

(function LoopIterationCount (Expr) i64)
(function DoWhile (Expr Expr) Expr :cost (+ c1 (* c2 (LoopIterationCount (DoWhile c1 c2))))) 
@oflatt
Copy link
Member Author

oflatt commented Feb 20, 2024

Alternatively, yihong has suggested we use egglog rule-based extraction, and we don't need to change egglog's implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants