This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/83253] -ftree-slsr causes performance regression
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 06 Dec 2017 15:40:56 +0000
- Subject: [Bug tree-optimization/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 #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Perhaps slsr should then if it is considering
Y = B + (i' * S)
X = B + (i * S)
to
Y = B + (i' * S)
X = Y + (i - i') * S
and if i and i' are INTEGER_CSTs call choose_mult_variant on both
i and (i - i') and see which one is more expensive (of course, even before that
with the check that power of 2 multiplication is always faster than anything
else, as expand_mult uses that unconditionally).