http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50557

--- Comment #6 from Igor Zamyatin <izamyatin at gmail dot com> 2011-10-07 
10:33:33 UTC ---
Indeed, overall register pressure is not increased. Even before IRA dumps show
that register pressure is actually kept on the same level. 

Looks like it is a tricky case we met.

First, we can see that loop consists of 4 same group of instructions. The only
difference is the index value used by arrays in each group. Before the
reassociation improvement the group located on lines 30-33 of the attached test
for some reasons (I haven't checked this yet) got a different sequence of
instructions than others. After William's reassociation changes all groups got
similar sequence. (Maybe there were some good reason for that group to be
different? :) )

Now the tricky part.
In "fast" (i.e. before William's commit) version for group on lines 30-33 IRA
managed to hold "c" in eax register. Moreover because of shorter live range of
"c" IRA managed to reuse eax inside the operations of 30-th line. For others
group all work was made through memory. 
Since reassociation improvement made all groups to have the same look, we
unsurprisingly got memory instead of registers which led to the performance
drop.

That is sort of my vision of the whole picture. Any comments, ideas?

Reply via email to