This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/83253] -ftree-slsr causes performance regression
- From: "mikulas at artax dot karlin.mff.cuni.cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Dec 2017 11:55:20 +0000
- Subject: [Bug target/83253] -ftree-slsr causes performance regression
- Auto-submitted: auto-generated
- References: <bug-83253-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253
--- Comment #15 from mikulas at artax dot karlin.mff.cuni.cz ---
> Well, in theory multiplication by 3 isn't that expensive on i?86/x86_64,
> because lea can do that. But multiplication by 4 should be still cheaper or as
> cheap as, because if we do * 3 by lea, we can do * 4 by lea too
Multiplication by 4 can be combined for free with another addition (i.e. lea
eax, [ebx + ecx * 4] and multiplication by 3 can't. So, multilication by 4
should have lower cost than multiplication by 3, even if both result in just
one instruction.