Missed Optimization: Inefficient Handling of Mutable Reference in Simple Conditional Assignment #124346
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
I-slow
Issue: Problems and improvements with respect to performance of generated code.
The following example shows how LLVM isn't able to optimize trivial branches when dealing with
&mut
pointers, while it can with owned values. I'd expect both functions to overridecurrent_len
with0
without needing to branch.The text was updated successfully, but these errors were encountered: