Re: Loop jamming!?

"Steve Simmons" <>
30 Jun 1997 22:52:07 -0400

          From comp.compilers

Related articles
Loop jamming!? (1997-06-24)
Re: Loop jamming!? (Steve Simmons) (1997-06-30)
Re: Loop jamming!? (Joel Williamson) (1997-06-30)
Re: Loop jamming!? (Sven) (1997-07-13)
Re: Loop jamming!? (1997-07-16)
Re: Loop jamming!? (Christopher Glaeser) (1997-07-18)
Re: Loop jamming!? (Stanley Chow) (1997-07-21)
Re: Loop jamming!? (Christopher Glaeser) (1997-07-22)
[8 later articles]
| List of all articles for this month |

From: "Steve Simmons" <>
Newsgroups: comp.compilers
Date: 30 Jun 1997 22:52:07 -0400
Organization: Nortel
References: 97-06-089
Keywords: optimize

Loop jamming is very similar to loop unrolling; however, loop
unrolling unrolls the innermost loop in the nest where loop jamming
unrolls an outer loop in the nest and jams the next inner loop


          FOR I= 1, 2
              FOR J= 1, N
                    A(I, J) = B(I, J)

This is a perfect candidate for loop jamming because it can
take advantage of cache locality (assuming the elements in
the first dimension are contiguous).

The result of a loop unroll and jam is...

          FOR J = 1, N
                A(1, J) = B(1, J)
                A(2, J) = B(2, J)

Note, this same optimization can be achieved by first
performing a loop interchange, and then a complete unroll.
However, this is one complete optimization.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.