-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Rewrite Rules Evaluation Project - Merging Relevant Synthesized Rewrite Rules #6174
Conversation
@@ -191,6 +210,7 @@ Expr Simplify::visit(const Select *op, ExprInfo *bounds) { | |||
(no_overflow_int(op->type) && | |||
(rewrite(select(x, y * c0, c1), select(x, y, fold(c1 / c0)) * c0, c1 % c0 == 0) || | |||
rewrite(select(x, c0, y * c1), select(x, fold(c0 / c1), y) * c1, c0 % c1 == 0) || | |||
rewrite(select(x, y + c0, c1), select(x, y, fold(c1 - c0)) + c0) || |
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.
This rule is causing the correctness_simplify failures. We should either remove it or possibly add a c1 != 0
predicate.
…enyc/Halide into evan-merge-selected-rules
@steven-johnson are the buildbot failures due to an LLVM breakage, or are they due to this PR? I don't see the failure on other PRs so I am assuming the latter, but just wanting to check |
LLVM breakage. Should be safe to ignore. |
Conducted experiments to analyze the performance effects of adding 4000+ synthesized rewrite rules to Halide.
Narrowed down the rules to 11 rewrite rules whose associative & commutative variants are added in this PR.
With these rewrite rules, Halide achieves >10% peak memory reductions in 192 cases in apps including camera_pipe, harris, nl_means, and stencil_chain, which is similar to the results (with all 4000+ rules) from this paper - https://dl.acm.org/doi/pdf/10.1145/3428234