-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
LoopVectorizer assert(AddressSpace == AS && with addrspacecast
is hit
#124759
Comments
Since nobody is looking at this, and it shows up as an assert for this, I'll try upstreaming my fix. |
@coldav sorry I missed this one. I think skipping the check you mentioned is probably not the right fix. I am looking into avoiding grouping pointers with different address spaces in the same dependency set. I am not super familiar with address space semantics, I am not sure if it is valid to access the same object with pointers to different address spaces? |
It depends on the address spaces. Address spaces may or may not overlap. If they do not overlap, then LLVM can assume that an object accessed from one address space and an object accessed from another do not alias. If the address spaces do overlap, however, that assumption is not valid. For the X86 target, address spaces 1-255 are reserved for user-defined code (https://llvm.org/docs/CodeGenerator.html#x86-address-spaces-supported) and interpreted for codegen purposes as aliases for address space zero, meaning all these address spaces overlap exactly. |
In some cases, it is possible for the same underlying object to be accessed via pointers to different address spaces. This could lead to pointers from different address spaces ending up in the same dependency set, which isn't allowed (and triggers an assertion). Update the mapping from underlying object -> last access to also include the accessing address space. Fixes llvm#124759.
Put up #129087 to avoid adding pointers from different addrspaces in the same dependency set |
Thanks @fhahn |
/cherry-pick 275baed |
Failed to cherry-pick: 275baed https://github.com/llvm/llvm-project/actions/runs/13596367487 Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request |
…ss. (llvm#129087) In some cases, it is possible for the same underlying object to be accessed via pointers to different address spaces. This could lead to pointers from different address spaces ending up in the same dependency set, which isn't allowed (and triggers an assertion). Update the mapping from underlying object -> last access to also include the accessing address space. Fixes llvm#124759. PR: llvm#129087
Manual PR to pick #129317 |
…ss. (llvm#129087) In some cases, it is possible for the same underlying object to be accessed via pointers to different address spaces. This could lead to pointers from different address spaces ending up in the same dependency set, which isn't allowed (and triggers an assertion). Update the mapping from underlying object -> last access to also include the accessing address space. Fixes llvm#124759. PR: llvm#129087
…ss. (llvm#129087) In some cases, it is possible for the same underlying object to be accessed via pointers to different address spaces. This could lead to pointers from different address spaces ending up in the same dependency set, which isn't allowed (and triggers an assertion). Update the mapping from underlying object -> last access to also include the accessing address space. Fixes llvm#124759. PR: llvm#129087
The following code produces an assert in RuntimeCheckingPtrGroup::addPointer()
This crashes with
opt --passes loop-vectorize /tmp/reduced.ll -S -o -
as follows:I've done some debugging and in
RuntimeCheckingPtrGroup::addPointer()
II can see the first two elements if RTCheck have the same dependency set but different address spaces.I did try removing the dependency set being equal continuing the loop here https://github.com/llvm/llvm-project/blob/main/llvm/lib/Analysis/LoopAccessAnalysis.cpp#L1219
This does seem to fix the issue but I was wary on whether this was just another symptom rather than the proper fix.
The text was updated successfully, but these errors were encountered: