-
Notifications
You must be signed in to change notification settings - Fork 15k
[DA] do not handle GEPs with different types #144088
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
Closed
Closed
Changes from all commits
Commits
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.
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.
This is just an example of DA missing some dependencies that should exist, due to the delinearization reasoning based on the GEP source element type. There are variants of this example that is not resolved by your patch, e.g., like the following:
A portion of the output is as follows:
However, the latter half of the first store overlaps with the first half of the second store (within the same iteration). Therefore, an
=
dependency exists for the k-loop, but DA currently does not recognize it.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.
Just wanted to double check the following: but doesn't this mean that DA is more conservative for this example? So that is okay in the sense it won't trigger problems?
Uh oh!
There was an error while loading. Please reload this page.
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.
My understanding is as follows (some of the notations may not be entirely accurate):
The two addresses (
idx0
andidx1
) are calculated as below:idx0 = %A + 262114 * i0 + 1024 * j0 + 4 * k0
idx1 = %A + 262114 * i1 + 1024 * j1 + 4 * (k1 + 1)
The memory address range affected by the first store is from
idx0
toidx0 + 7
, and the second store affects the range fromidx1
toidx1 + 7
. DA calculates the conditions between[i0, j0, k0]
and[i1, j1, k1]
under which these two ranges overlap. In this case, they overlap when either of the following conditions1 holds:[i0, j0, k0] = [i1, j1, k1]
[i0, j0, k0] = [i1, j1, k1 + 1]
i0 = i1
andj0 = j1 + 1
andk0 = 0
andk1 = 254
Therefore, at least,
k
has*
dependence, andj
has=
and>
dependencies.Footnotes
This is a necessary condition, but not a sufficient condition. ↩
Uh oh!
There was an error while loading. Please reload this page.
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.
As I mentioned in #145050 (comment), both the test in
DifferentOffsets.ll
and the IR in the above comment are incorrect. Sorry for the confusion. For the former one, I created a PR #147479 to fix it. For the latter case, the correct IR should be as follows:I tried the revised version, and found that DA correctly handles the two stores for
idx0
andidx1
.However, DA still fails to handle loop-carried dependency on the same instruction, which is not resolved by the change in this PR.