(j3.2006) "Contiguous" doesn't quite do what I need
Mon Mar 26 15:54:34 EDT 2007
On Mon, 2007-03-26 at 12:28 -0500, Bill Long wrote:
> Aleksandar Donev wrote:
> >As to the "more advanced compiler technology is needed to make any use of the
> >actual value in generating optimal code," I am pretty sure most compilers
> >have that for a 2x2 array, including Cray's. I would hope you use such info
> >in determining what to do with short loops or array statements over
> >dimensions of size 2...
> I was referring to the case where the bounds were not visible at compile
> time. The "advanced techniques" might include things like runtime
> feedback and dynamic recompilation. Certainly, if the user writes 2,2
> almost any compiler can generate the right code.
Well, I've been writing about the case where the bounds are not only
visible at compile time, but are given by initialization expressions.
Of course, it's easy to give the appearance of refuting an argument by
changing the topic.
I took to writing out 2x2 X 2x2 MATMUL longhand because none of the
compilers I use inline it; they all call their favorite subroutines,
which appear to spend more time fooling around to figure out the optimum
blocking than actually doing the multiply. Even after doing this,
however, the compiler is still going to the dope vector to compute the
location of the next 2x2 in each array. Fortunately, this process is in
my fourth-most-prolific cycle consumer (if you believe gprof), which was
my second-most-prolific cycle consumer until I inlined MATMUL by hand.
Van Snyder | What fraction of Americans believe
Van.Snyder at jpl.nasa.gov | Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or
disapproved by JPL, CalTech, NASA, the President, or anybody else.
More information about the J3