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]
Other format: [Raw text]

Re: Transformations to increase parallelism


On Mon, 21 Jul 2003, Jan Hoogerbrugge wrote:

> Hi,
> 
> Are there optimizations in gcc that increase instruction level parallelism? 
> For example:
> 
> void foo(int *p, int a)
> {
>         a += 2;
>         p[0] = a;
>         a += 2;
>         p[1] = a;
> }
> 
> compiles to
> 
>         add a, 2 -> tmp1
>         store p[0], tmp1
>         add tmp1, 2 -> tmp2
>         store p[1], tmp2
> 
> However, a more parallel translation would be:
> 
>         add a, 2 -> tmp1
>         store p[0], tmp1
>         add a, 4 -> tmp2
>         store p[1], tmp2
> 
> In this case the two adds and the two stores can be executed in parallel.
> 
> Jan

No. I've mentioned similar problems before on this list, though.

GCC really needs a pass to preprocess the instructions before sched1 to
give the scheduler more scheduling freedom, especially on many-issue
processors.

Toshi




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