-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
InstCombine incorrectly folds select of vector #49176
Comments
assigned to @rotateright |
I'll look at this. Reduced (don't need the initial insert/extract): define void @src(<2 x i32> %x) { |
We already had a regression test that Alive2 flags as a potential miscompile. I think we just overlooked a basic requirement of select value equivalence substitution: Godbolt shows that this would be a new miscompile for release 12.0: I'm not sure what changed to make that visible, but let's see if we can still get this into the release. Marking as release blocker. |
It would be good to check that the same problem doesn't exist in InstSimplify (see simplifySelectWithICmpCond). |
Aha - I'm losing track of reviews: If that change is required to expose the bug, then it's not in the 12.0 release AFAIK. |
Yes, good point. Looks like we can still hit the bug there too. https://alive2.llvm.org/ce/z/HGETc3 Not sure if it's just me, but the online instance of Alive2 is acting strange, so for reference that should show: => define <2 x i32> @tgt(<2 x i32> %x) { Transformation doesn't verify! Example: Source: Target: |
InstSimplify patches: |
Thank you for the swift fix! |
So all 4 commits listed in "Fixed By Commits" need to be backported? |
Yes, please. Technically, we could fix this bug with the 1st two (instcombine) patches alone. But backporting all 4 (two patches are just adding tests / NFC) would be the best way to be sure we don't hit the problem in any code. |
Can you double check that the list of commits is correct. 2a0f512eaca does not exist in the git tree. |
Sorry lost a digit - that should be: |
Looks like 78e5cf6 and e2a0f51 were cherry-picked to 12.x, and I'm now seeing llvm/test/Transforms/InstSimplify/select.ll fail on that branch: /data/users/smeenai/llvm-project/llvm/test/Transforms/InstSimplify/select.ll:974:15: error: CHECK-NEXT: is not on the line after the previous match |
Yes - this is my fault for letting a formatting change slip into the commit. I think the cherry-pick is over-reaching as described here (we picked up an extra test for the branch unintentionally): |
I committed a patch that should fix this: |
Merged: 8e2ff38 |
Extended Description
This is incorrect: https://alive2.llvm.org/ce/z/8X-4kR
If input is <0, 2>, (%x, %y) is (2, 2) in src, but it becomes (0, 2) in tgt.
The text was updated successfully, but these errors were encountered: