Function calls in logic expressions sometimes cause optimization misses #93279
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-bug
Category: This is a bug.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Calling functions, including
const
ones, on a logic expression (ega || b
) sometimes cause certain optimizations to be missedI tried this code:
Expected result: both functions (
check1
andcheck2
) generate the same assembly codeActual result:
Godbolt link: https://godbolt.org/z/vfPe13G8P
Additionally, changing the comparison order affects optimization:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: