-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
[ArgPromotion] Miscompile at -O3 #84807
Comments
Hmm, cannot reproduce with plain opt. |
Ok reproduced with custom use list order. Will prepare a fix soon |
Test case for #84807, showing a mis-compile in ArgPromotion.
The TranspBlocks set was used to cache aliasing decision for all processed loads in the parent loop. This is incorrect, because each load can access a different location, which means one load not being modified in a block doesn't translate to another load not being modified in the same block. All loads access the same underlying object, so we could perhaps use a location without size for all loads and retain the cache, but that would mean we loose precision. For now, just drop the cache. Fixes llvm#84807
Just out of curiosity, when querying AA, we are expecting |
No, AFAICT AA is working correctly, but the results are used for incorrect caching, see #84835 |
Makes sense, thanks (didn't see the PR opened by the time had commented). |
Unfortunately Github does not seem to notify when a PR mentions an issue :( |
The TranspBlocks set was used to cache aliasing decision for all processed loads in the parent loop. This is incorrect, because each load can access a different location, which means one load not being modified in a block doesn't translate to another load not being modified in the same block. All loads access the same underlying object, so we could perhaps use a location without size for all loads and retain the cache, but that would mean we loose precision. For now, just drop the cache. Fixes #84807 PR: #84835
Test case for llvm#84807, showing a mis-compile in ArgPromotion. (cherry picked from commit 31ffdb5)
The TranspBlocks set was used to cache aliasing decision for all processed loads in the parent loop. This is incorrect, because each load can access a different location, which means one load not being modified in a block doesn't translate to another load not being modified in the same block. All loads access the same underlying object, so we could perhaps use a location without size for all loads and retain the cache, but that would mean we loose precision. For now, just drop the cache. Fixes llvm#84807 PR: llvm#84835 (cherry picked from commit bba4a1d)
/pull-request #84945 |
Test case for llvm#84807, showing a mis-compile in ArgPromotion. (cherry picked from commit 31ffdb5)
The TranspBlocks set was used to cache aliasing decision for all processed loads in the parent loop. This is incorrect, because each load can access a different location, which means one load not being modified in a block doesn't translate to another load not being modified in the same block. All loads access the same underlying object, so we could perhaps use a location without size for all loads and retain the cache, but that would mean we loose precision. For now, just drop the cache. Fixes llvm#84807 PR: llvm#84835 (cherry picked from commit bba4a1d)
Reduced test case: https://godbolt.org/z/5z5sYv4nq
Bisected to
ArgumentPromotionPass
.Before:
After:
We cannot promote the loads because
%q
aliases with@f
.LLVM version: 0f501c3
The text was updated successfully, but these errors were encountered: