Closed
Description
int r3(int n, int q)
{
return n - q * -7;
}
This can be optimised to return (n + q * 8) - q;
on architectures where n + q * 8
can be done in a single instruction (which includes x86). This transformation is done by GCC, but not by LLVM.
See also https://godbolt.org/z/4anx8846f for a Godbolt comparison