-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Arith] Simplify nested if_then_else #12749
[Arith] Simplify nested if_then_else #12749
Conversation
49c638c
to
175eb97
Compare
@tvm-bot rerun |
d50e5c1
to
8876e62
Compare
const PrimExpr& then_expr = op->args[1]; | ||
const PrimExpr& else_expr = op->args[2]; | ||
const CallNode* inner_call = then_expr.as<CallNode>(); | ||
if (inner_call != nullptr && inner_call->op.same_as(tir::builtin::if_then_else())) { |
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.
Overall LGTM. I wonder if this implies that only one level of nested if_then_else could exist in current TIR structure.
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.
it supports multiple levels, as this mutator is recursive (then_expr
here is from the recursion result)
Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com>
8876e62
to
23dca66
Compare
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.
LGTM!
[Arith] Simplify nested if_then_else Co-authored-by: Bohan Hou <32121147+spectrometerHBH@users.noreply.github.com>
cc @junrushao1994 @spectrometerHBH