Open
Description
openedon Sep 16, 2024
I'm not entirely sure whether this belongs to LLVM or rust (I haven't triaged), but let's start here.
I tried this code: https://godbolt.org/z/E5W74re7v
which could potentially folded to a single constant, but the optimizer fails to recognize.
Changing the inner if condition from t + s + r == 10
to t + s == 10
results into the LLVM IR being a single line function:
ret i64 63000000000
. In godbolt: https://godbolt.org/z/zfchrszbW
I would expect both cases to fold to a constant, but maybe I'm missing something here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generationArea: Code generationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.