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
SimplifyCFG or InstCombine incorrect in the presence of overflow #54311
Labels
Comments
Hm, yes: https://alive2.llvm.org/ce/z/b2fxWg |
Ok, the problem is in instcombine: https://alive2.llvm.org/ce/z/y9Dp8A |
Probably these SPF patterns need to be removed: llvm-project/llvm/lib/Analysis/ValueTracking.cpp Lines 5805 to 5817 in abc8ca6
|
These were added in cfcc42b. |
Thanks for the report and analysis! I'll make a patch to remove the wrong analysis. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
overflow_simplifycfg.ll.log
Running:
opt -simplifycfg overflow_simplifycfg.ll
shows the issue.The branching is removed and the difference is done unconditionally. In the original test, the difference overflows.
This was found following the change in https://reviews.llvm.org/D98152. The test does not overflow following the SimplifyCFG transform but does overflow after Instcombine. I haven't understood why this is yet.
Pertinent diffs from original test:
Before SimplifyCFG:
After SimplifyCFG:
Before instcombine:
After instcombine:
The text was updated successfully, but these errors were encountered: