This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: g77 performance on ALPHA


[ ugh, following up on myself ]

In article <7qf91s$qhp$1@palladium.transmeta.com>,
Linus Torvalds <torvalds@transmeta.com> wrote:
>
>It looks like the Compaq compiler knows the stores cannot alias the
>loads, while g77 thinks (or tells the instruction scheduler) that the
>stores could alias and thus they never get moved down. 

Naah, I didn't notice that the gcc output actually has all the
compare-and-branch instructions still in the unrolled body of the loop,
and those will obviously be serialization points regardless of any
aliases: the reason the loads haven't migrated up and the stores down
like they should is all those control dependencies. 

The only way to get close to the compaq compiler is to do the proper
iteration unrolling, testing the loop count just once for "4 or more
iterations" and then the actual unrolled body would not have any control
dependencies. 

For some reason I thought gcc already did that, but it obviously
doesn't.  Strange.  Without doing that there isn't all that much point
in unrolling in the first place - you increase your icache footprint
without really improving the code all that much. 

		Linus

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]