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
ConstraintElimination: incorrect fold of pointer comparison #49624
Comments
I think the testcase in Transforms/ConstraintElimination/loops-header-tested-pointer-cmps.ll exposes a similar issue. See the counterexample below. I think the issue is that it ignores that gep sign-extends the argument. And then this expression
|
Thanks for the report! The issue was that it incorrectly assumed GEP indices are signed positive. The code was missing a corresponding pre-condition. That should be fixed in 06f3ef6 |
Extended Description
Test: Transforms/ConstraintElimination/gep-arithmetic.ll
The optimization below is incorrect as it misses one case:
lower < src.end < src < upper < src.step
The text was updated successfully, but these errors were encountered: