-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Miscompile with opt -passes="constraint-elimination" #76713
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
Labels
Comments
Looks like an issue with |
Thanks for the quick fix! I've verified it solves the problem I saw. |
@mikaelholmen thanks for the reproducer! |
(appreciated as always, thanks for your extensive testing) |
fhahn
added a commit
to fhahn/llvm-project
that referenced
this issue
Jan 3, 2024
See llvm#76713. (cherry-picked from 1fa18fe)
fhahn
added a commit
to fhahn/llvm-project
that referenced
this issue
Jan 3, 2024
The current patterns for NUWSub decompositions do not handle negative constants correctly at the moment (causing llvm#76713). Replace the incorrect pattern by more general code that recursively decomposes the operands and then combines the results. This is already done in most other places that handle operators like add/mul. This means we fall back to the general constant handling code (fixes the mis-compile) while also being able to support reasoning about decomposable expressions in the SUB operands. Fixes llvm#76713. (cherry-picked from 3c127e8)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
llvm commit: 5842dfe
Reproduce with:
opt -passes="constraint-elimination" bbi-90501.ll -S -o -
bbi-90501.ll.gz
There are two nested loops in the input that should finish and then we should end up at
but with constraint-elimination the condition in bb.5 is changed to
so we will go to
instead.
The text was updated successfully, but these errors were encountered: