-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[DA] Introduce domain for monotonicity #170684
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
Draft
kasuga-fj
wants to merge
6
commits into
llvm:main
Choose a base branch
from
kasuga-fj:da-propose-monotonicity-domain
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.
Draft
Conversation
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
c78fba0 to
e54ced2
Compare
🐧 Linux x64 Test Results
Failed Tests(click on a test name to see its output) LLVMLLVM.Analysis/DDG/basic-b.llLLVM.Transforms/LoopFusion/da_separate_loops.llLLVM.Transforms/LoopUnrollAndJam/dependencies.llLLVM.Transforms/LoopUnrollAndJam/unroll-and-jam.llIf these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR is a proposal that is derived from #162281, and not intended to be merged as is.
Current definition of monotonicity assumes its domain as
[0, BTC_1] x [0, BTC_2] x ... x [0, BTC_n]without justification. In fact, the result of monotonicity check is incconsistent in the following cases:i < 42exists and the exact backedge-taken count of the i-loop is larger than 42.To address these issues, this PR introduces a domain for monotonicity and modifies the definition of monotonicity accordingly. Also changes the interface of the monotonicity check function to explicitly take the domain as an argument. Currently the following domains are supported:
EntireDomain:[0, BTC_1] x [0, BTC_2] x ... x [0, BTC_n]EffectiveDomain:[L_1, U_1] x [L_2, U_2] x ... x [L_n, U_n]which is a superset of the actual execution domain. Note that we don't know the actual values ofL_kandU_k.Fis monotonic inEffectiveDomain", it means that there exists valuesL_kandU_kfor allksuch thatFis monotonic in[L_1, U_1] x [L_2, U_2] x ... x [L_n, U_n]F(i_1, i_2, ..., i_n)is actually evaluated, thenL_k <= i_k <= U_kfor allk.As a first step, monotonicity checks are added in
strongSIVtestandsymbolicRDIVtest. In addition, independence tests that use an exact backedge-taken count have been rewritten to evaluate the addrecs at the first and last iterations, rather than relying on the existing inequality checks, which require additional overflow checks.