Missed optimization when removing intermediate #116150
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
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.
Using Rust 1.72.0:
compiles to:
But adding an intermediate before the conditional appears to help:
compiles to:
https://godbolt.org/z/bf6jW9d3c
This intermediate could be an argument in a call, which is in fact how I originally noticed it, i.e. this:
compiles better than:
The text was updated successfully, but these errors were encountered: