-
Notifications
You must be signed in to change notification settings - Fork 12k
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
WRONG code when enabling Loop Vectorizer with -Os #82665
Comments
Hm interesting, let me take a look |
Reproduces on AArch64 with |
At the moment, getUnderlyingObjects simply continues for phis that do not refer to the same underlying object in loops, without adding them to the list of underlying objects, effectively ignoring those phis. Instead of ignoring those phis, add them to the list of underlying objects. This fixes a miscompile where LoopAccessAnalysis fails to identify a memory dependence, because no underlying objects can be found for a set of memory accesses. Fixes llvm#82665.
…her (#84339) At the moment, getUnderlyingObjects simply continues for phis that do not refer to the same underlying object in loops, without adding them to the list of underlying objects, effectively ignoring those phis. Instead of ignoring those phis, add them to the list of underlying objects. This fixes a miscompile where LoopAccessAnalysis fails to identify a memory dependence, because no underlying objects can be found for a set of memory accesses. Fixes #82665. PR: #84339
/cherry-pick b274b23 |
Failed to cherry-pick: b274b23 https://github.com/llvm/llvm-project/actions/runs/8252583153 Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request |
Test case for llvm#82665. (cherry picked from commit 4cfd4a7)
…her (llvm#84339) At the moment, getUnderlyingObjects simply continues for phis that do not refer to the same underlying object in loops, without adding them to the list of underlying objects, effectively ignoring those phis. Instead of ignoring those phis, add them to the list of underlying objects. This fixes a miscompile where LoopAccessAnalysis fails to identify a memory dependence, because no underlying objects can be found for a set of memory accesses. Fixes llvm#82665. PR: llvm#84339 (cherry picked from commit b274b23)
/pull-request #84950 |
Test case for llvm#82665. (cherry picked from commit 4cfd4a7)
…her (llvm#84339) At the moment, getUnderlyingObjects simply continues for phis that do not refer to the same underlying object in loops, without adding them to the list of underlying objects, effectively ignoring those phis. Instead of ignoring those phis, add them to the list of underlying objects. This fixes a miscompile where LoopAccessAnalysis fails to identify a memory dependence, because no underlying objects can be found for a set of memory accesses. Fixes llvm#82665. PR: llvm#84339 (cherry picked from commit b274b23)
This program should print 1:
cat wrong0.i
In the first iteration, IntPtr2 points to ValB and sets it to 1. Then, only in the second iteration does IntPtr2 point to Val and set that to 1. I wonder if the loopvectorizer has done something wrong, or if there is some later pass possibly that is messing it up..?
@fhahn @david-arm @nilanjana87
The text was updated successfully, but these errors were encountered: