|Does Loop Fission Work in Single Cores? email@example.com (kunjaan) (2009-05-06)|
|Re: Does Loop Fission Work in Single Cores? firstname.lastname@example.org (George Neuner) (2009-05-06)|
|Re: Does Loop Fission Work in Single Cores? email@example.com (Harold Aptroot) (2009-05-07)|
|Re: Does Loop Fission Work in Single Cores? firstname.lastname@example.org (Florian Stock) (2009-05-07)|
|From:||"Harold Aptroot" <email@example.com>|
|Date:||Thu, 7 May 2009 10:23:52 +0200|
|Organization:||A noiseless patient Spider|
|Posted-Date:||07 May 2009 07:34:45 EDT|
"kunjaan" <firstname.lastname@example.org> wrote in message
> When does it make sense to use Loop fission/distribution if I am
> compiling for a single core processor?
It's hard to answer questions like this.
I could tell you that it makes sense whenever it speeds up execution, but
such an answer is completely useless.
It can speed up execution though, such as when 2 big arrays are accessed in
the loop body but the work performed on them is not interdependant and the
arrays are so big that they do not fit in the cache. If that's the case,
then you're probably memory IO bound, since the CPU might not understand
your memory access pattern, usually they only known about forward linear
strided access and you'd be quickly switching back and forth between two
unrelated places. Confusing the CPU is almost never a good thing. Using
prefetch hints would also help, but the best prefetch offset (and the size
of the prefetched block) depend on the CPU model/brand. Splitting the loops
also works, as does interleaving the arrays (but it's often hard to prove
that it's possible to interleave them without breaking something).
Distributing the loop in 2 or more threads helps if for example you have
slow IO in the loop body, or when the CPU has HyperThreading.
Note that these were all examples, there will be more cases in which it will
Return to the
Search the comp.compilers archives again.