-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[InstCombine] Miscompile at -O1 #85536
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
Reduced IR: https://alive2.llvm.org/ce/z/Gv9zkm
|
@dtcxzyw That last transform is correct for GlobalOpt, alive2 does not support IPO transforms. |
Oh, sorry about my mistake. I will provide a godbolt link. |
The root cause: https://alive2.llvm.org/ce/z/ThJs3Y
|
We forget to drop the |
Minimal reproducer: https://alive2.llvm.org/ce/z/aBubZ4
|
@dtcxzyw We're probably missing a call to dropUBImplyingAttrsAndMetadata in FoldOpIntoSelect. |
…struction (llvm#85542) When speculating an instruction in `InstCombinerImpl::FoldOpIntoSelect`, the call may result in undefined behavior. This patch drops all UB-implying attrs/metadata to fix this. Fixes llvm#85536. (cherry picked from commit 252d019)
Reduced test case: https://godbolt.org/z/z1a3665hd
Reduced LLVM IR: https://alive2.llvm.org/ce/z/hWuhFG
LLVM version: 74d1a40
cc @nikic
The text was updated successfully, but these errors were encountered: