[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-14 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 --- Comment #12 from Bill Schmidt --- By contrast, on powerpc64le, we see: - mult_by_coeff_cost (3, E_SImode, true) returns a cost of 8 - mult_by_coeff_cost (4, E_SImode, true) returns a cost of 4 These are the sort of costs one would expect,

[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-14 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 --- Comment #11 from Bill Schmidt --- OK, for the i386 case, this simply comes down to the following. - mult_by_coeff_cost (3, E_SImode, true) returns a cost of 4 - mult_by_coeff_cost (4, E_SImode, true) returns a cost of 8 Garbage in, garbag

[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-14 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 --- Comment #10 from Bill Schmidt --- I see that I was looking at the wrong leg here. This is a CAND_ADD, not a CAND_MULT, and I'm getting strange cost results on that path. The proposed change is still appropriate in my view, but not relevant

[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-13 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 --- Comment #9 from Bill Schmidt --- I was able to build an i386 cross, and this wasn't sufficient to solve the problem. I see: Processing dependency tree rooted at 1. Inserting initializer: slsr_10 = scale_7(D) * 3; Increment vector: 0 in

[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-13 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 --- Comment #8 from Bill Schmidt --- Revised patch: Index: gcc/gimple-ssa-strength-reduction.c === --- gcc/gimple-ssa-strength-reduction.c (rev

[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-12 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 --- Comment #7 from Bill Schmidt --- Thanks, Jakub, good catch on the HWI overflow. I'll make those changes and re-test. FWIW, the patch as proposed above passes regstrap and will be good enough for testing whether this indeed is the right appr

[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 --- Comment #6 from Jakub Jelinek --- (In reply to Bill Schmidt from comment #5) > Here's an untested patch (bootstraps successfully but regtest is still > ongoing): > > Index: gcc/gimple-ssa-strength-reduction.c

[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-12 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 --- Comment #5 from Bill Schmidt --- Here's an untested patch (bootstraps successfully but regtest is still ongoing): Index: gcc/gimple-ssa-strength-reduction.c ==

[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-12 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 --- Comment #4 from Bill Schmidt --- I think the issue may be in this code: /* For any other increment, if this is a multiply candidate, we must introduce a temporary T and initialize it with

[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-07 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 --- Comment #3 from Bill Schmidt --- Apologies for not responding sooner -- I've been out of pocket for the last week. I'll have a look when I get unburied (probably next week). Bill

[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 --- Comment #2 from Jakub Jelinek --- 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

[Bug tree-optimization/83253] -ftree-slsr causes performance regression

2017-12-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83253 Richard Biener changed: What|Removed |Added Keywords||missed-optimization Status|