Missed optimization for .rem_euclid(2^n) on signed integer types. #115855
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
When calling
.rem_euclid(n)
on a signed integer type, it fails to apply the optimization for powers of 2, where it should do a bitwise AND operation instead.Missed optimization
How it should be optimized
Testing the optimization:
n = 2
?play
n = 1
?play
n = 4
?play
Curiously, the optimization is applied to unsigned integers just fine
The text was updated successfully, but these errors were encountered: