-
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][TIR] Check for constant offsets of known literal constraints #13023
[Arith][TIR] Check for constant offsets of known literal constraints #13023
Conversation
This is part of a series of improved simplifications, as part of #12261. |
97945e9
to
15c1b1c
Compare
Rebased onto main to resolve merge conflict. |
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment. Generated by tvm-bot |
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.
Very cool! LGTM.
Previously, the checks for a literal constraint would find exact matches for an inequality, but any alterations to the conditional would break this exact matching. This commit introduces checks for constant offsets relative to a known value. These checks are not always expressible using the existing `ConstIntSetAnalyzer`, which represents allowed values using a single contiguous region. (e.g. `i!=5` is not representable, because it requires a region for `i<5` and another for `i>5`.) This implementation reuses the internal representation for inequalities introduced in apache#12863, along with much of its implementation. However, the indirect comparisons (e.g. using `a < b` and `b < c` to prove that `a < c`) introduced in that PR still require an explicit flag to be used.
15c1b1c
to
bb2f4ed
Compare
Thank you! (Rebasing onto main to resolve conflicts.) |
@tvm-bot rerun |
…pache#13023) Previously, the checks for a literal constraint would find exact matches for an inequality, but any alterations to the conditional would break this exact matching. This commit introduces checks for constant offsets relative to a known value. These checks are not always expressible using the existing `ConstIntSetAnalyzer`, which represents allowed values using a single contiguous region. (e.g. `i!=5` is not representable, because it requires a region for `i<5` and another for `i>5`.) This implementation reuses the internal representation for inequalities introduced in apache#12863, along with much of its implementation. However, the indirect comparisons (e.g. using `a < b` and `b < c` to prove that `a < c`) introduced in that PR still require an explicit flag to be used.
…pache#13023) Previously, the checks for a literal constraint would find exact matches for an inequality, but any alterations to the conditional would break this exact matching. This commit introduces checks for constant offsets relative to a known value. These checks are not always expressible using the existing `ConstIntSetAnalyzer`, which represents allowed values using a single contiguous region. (e.g. `i!=5` is not representable, because it requires a region for `i<5` and another for `i>5`.) This implementation reuses the internal representation for inequalities introduced in apache#12863, along with much of its implementation. However, the indirect comparisons (e.g. using `a < b` and `b < c` to prove that `a < c`) introduced in that PR still require an explicit flag to be used.
Previously, the checks for a literal constraint would find exact matches for an inequality, but any alterations to the conditional would break this exact matching. This commit introduces checks for constant offsets relative to a known value. These checks are not always expressible using the existing
ConstIntSetAnalyzer
, which represents allowed values using a single contiguous region. (e.g.i!=5
is not representable, because it requires a region fori<5
and another fori>5
.)This implementation reuses the internal representation for inequalities introduced in #12863, along with much of its implementation. However, the indirect comparisons (e.g. using
a < b
andb < c
to prove thata < c
) introduced in that PR still require an explicit flag to be used.