Add simplifier rules helpful for specialization#5836
Conversation
src/Simplify_Max.cpp
Outdated
| rewrite(max(x, max(min(x, y), z)), max(x, z)) || | ||
| rewrite(max(x, max(min(y, x), z)), max(x, z)) || | ||
|
|
||
| rewrite(max(select(x, y, z), z), select(x, max(y, z), z)) || |
There was a problem hiding this comment.
@jn80842 I believe this rule is OK because we prefer stronger IR nodes at the root of the true, all else equal. Is that right?
There was a problem hiding this comment.
Ok, according to Julie this rule is actually not OK because we prefer weaker nodes at the root, so this may fight with another rule that moves a max inside a select for some reason.
There was a problem hiding this comment.
Hmm, I'm going to have to look at this, because I did check that these rules are needed, and they really are. I guess I'll have to try to find a more specific rule.
|
The rules all formally verify, but I'd like @jn80842 to double-check the one max/select distribution rule that seems barely-ordered to me. |
|
The OSX failure is unrelated (will be fixed by #5841), should be good to land |
|
The new rules all formally verify |
* Add simplifier rules helpful for specialization. * clang-format * Revert sketchy select simplification. * Add different rules.
This PR makes it easier to simplify the expressions resulting from bounds inference on funcs with specializations.