-
Notifications
You must be signed in to change notification settings - Fork 13.5k
DependenceAnalysis is not access size aware. #16183
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
Comments
The current implementation of the dependence analysis test does not handle access functions reading/writing a different number of bytes. There are ways to extend DA to check for all the covered bytes by each R/W, however that would require more code for little benefit. This is really a corner case that does not occur often in codes. The fix is to disable such R/W memory accesses as "aliasing". I will post a patch like this:
|
…sizes This fixes bug llvm#16183 where the elements of a same array are accesses as i32 and i64. This is not handled by the array dependence analysis.
…sizes This fixes bug llvm#16183 where the elements of a same array are accesses as i32 and i64. This is not handled by the array dependence analysis.
…sizes This fixes bug llvm#16183 where the elements of a same array are accesses as i32 and i64. This is not handled by the array dependence analysis.
…sizes This fixes bug llvm#16183 where the elements of a same array are accesses as i32 and i64. This is not handled by the array dependence analysis.
…sizes This fixes bug llvm#16183 where the elements of a same array are accesses as i32 and i64. This is not handled by the array dependence analysis.
…sizes This fixes bug llvm#16183 where the elements of a same array are accesses as i32 and i64. This is not handled by the array dependence analysis.
…sizes This fixes bug llvm#16183 where the elements of a same array are accesses as i32 and i64. This is not handled by the array dependence analysis.
Fixed with #123436 |
Extended Description
Consider the following function:
define i64 @alias(i32* nocapture %A) nounwind uwtable {
entry:
%arrayidx = getelementptr inbounds i32* %A, i64 1
store i32 2, i32* %arrayidx, align 4
%0 = bitcast i32* %A to i64*
%1 = load i64* %0, align 8
ret i64 %1
}
Ignoring size of the memory location accessed in
store i32 2, i32* %arrayidx, align 4
and
%1 = load i64* %0, align 8,
The addresses pointed by %arrayidx and %0 doesn't alias each other, and hence DependenceAnalysis claims there is not dependencies from the store to the load, and gives the following output:
da analyze - none!
da analyze - none!
da analyze - none!
However, the above result is incorrect (at least for x86), there should be a dependency from from the store to the load, because the memory location written by the store overlap with the memory location read by the load.
The text was updated successfully, but these errors were encountered: