-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow the simplifier to use facts in its can_prove() predicates. #9400
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
Open
mcourteaux
wants to merge
58
commits into
main
Choose a base branch
from
mcourteaux/can-prove-facts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
1399d13
Let can_prove predicates use the simplifier's known facts
mcourteaux 6fa6d43
Make fact lookup aware of comparison direction and strictness
mcourteaux bd22e41
Don't re-enter fact-driven rewrite rules from inside a can_prove
mcourteaux 0c73eea
Express the can_prove re-entry guard as a depth limit
mcourteaux e6866e7
Add a non-recursive known_true predicate for rewrite rules
mcourteaux 6664311
Fix parenthesis of Simplify_Div.
mcourteaux 8af31a8
Guard against can_prove recursion at its source
mcourteaux abda89a
Fall back to fact lookup at the can_prove depth cap
mcourteaux f7bf9b7
Use a direct fact lookup at the can_prove depth cap, not a tree walk
mcourteaux 1e9eb9c
Answer ordering questions from constant bounds on differences, not IR
mcourteaux d82b2ec
Lower the can_prove depth limit to two
mcourteaux 01a2108
Let known_difference reason without facts
mcourteaux 9ace36b
Test the fact-free reasoning in known_difference
mcourteaux 5b7483c
Reject known_difference candidates on a summary before comparing Exprs
mcourteaux 74e1d92
Gate the difference rules on the difference table, not on any fact
mcourteaux 185ead5
Reject a difference lookup against the whole table in one test
mcourteaux 260cc16
Key same-type pairs by their kind rather than collapsing them onto on…
mcourteaux 1915e46
Don't order a min or max from the condition of an if
mcourteaux fa3b132
Order a min or max from an if's condition only once regions are derived
mcourteaux 9e825cd
Review fixes: type-gate the structural bound, and drop what nothing r…
mcourteaux 8be980b
Gate every fact on the phase, not just the ones from ifs
mcourteaux 0d05e92
Test that a wrapping type is not ordered from a fact about a sum
mcourteaux ee827e9
Add a cheap hash to Expr nodes for fast IREquality pre-checks
abadams bc1eaee
Pack the Expr hash into IRNode::node_type's spare bits
abadams 3b7820c
Fix set_hash on big-endian: shift the high-quality bits into place
abadams 566b056
Fix (U)IntImm hash discarding small values entirely
abadams 2b43673
Tighten IRNode hash comment
abadams 739cae9
Merge remote-tracking branch 'origin/abadams/expr_hash' into mcourtea…
mcourteaux ef93203
Use the Expr hash as the difference filter's summary
mcourteaux 6169aca
Read the Expr hash directly rather than through a wrapper
mcourteaux 9b0688c
Drop the cached hashes from KnownBound
mcourteaux 9b6a8d1
Learn constant bounds on affine differences, peeling mul and div
mcourteaux ece045c
Solve scaled bounds exactly, rounding inwards
mcourteaux 001ee6b
Don't drop an offset that overflows while peeling
mcourteaux 281e6be
Use the learned differences as bounds on Add and Sub
mcourteaux cbe1c70
As the known_differences becomes an arithmetic prover, it opens the d…
mcourteaux a8628c3
Gate call to peel_affine_terms on node type
abadams 618e337
Merge branch 'main' into mcourteaux/can-prove-facts
mcourteaux 6b59abd
Merge branch 'main' into mcourteaux/can-prove-facts
mcourteaux e7169af
cleanup
mcourteaux 0c32b78
Merge DiffBound into LinearDiffBound and remove KnownTrue
mcourteaux db62c66
Drop the cap on peeled division denominators
mcourteaux c986d1c
Round in solve_scaled_bound with div_imp
mcourteaux d6ec950
Leave INT64_MIN / -1 open in solve_scaled_bound
mcourteaux 71222e3
Require simplified facts in learn_true/learn_false
mcourteaux 0ee94a7
Test that an RDom's where clause doesn't remove a clamp on its index
mcourteaux 9fd71f0
Test a where clause on a scaled reduction variable
mcourteaux 0fe2aaf
Name the indices an if condition bounds, and drop ScopedRegionsInferred
mcourteaux 7712b54
Keep the original if condition outside the one on the named index
mcourteaux d19a4a0
Test that a where clause on a compound index still bounds its parts
mcourteaux 0c7cc7e
Rename the test to what it checks: bounds of a compound index from a …
mcourteaux f992206
Merge branch 'main' into mcourteaux/can-prove-facts
mcourteaux 070b53a
Chain the difference facts per bucket instead of scanning the whole t…
mcourteaux 90ff0d0
Skip the work a difference query can't use
mcourteaux f518796
Decide a min or max from one difference lookup, not two rules
mcourteaux dd88275
Branch explicitly around the gcd for a unit coefficient
mcourteaux 2f35b21
Merge branch 'main' into mcourteaux/can-prove-facts
mcourteaux da02d71
Name a select inside an index too
mcourteaux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think this probably wants to consider Select as well