Re: LDD/STD Optimizations (Preston Briggs)
Tue, 10 Mar 1992 18:15:14 GMT

          From comp.compilers

Related articles
LDD/STD Optimizations (1992-03-03)
Re: LDD/STD Optimizations idacrd!desj@uunet.UU.NET (1992-03-09)
Re: LDD/STD Optimizations (1992-03-10)
Re: LDD/STD Optimizations (1992-03-10)
Re: LDD/STD Optimizations idacrd!desj@uunet.UU.NET (1992-03-11)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Preston Briggs)
Keywords: optimize, architecture
Organization: Rice University, Houston
References: 92-03-018 92-03-034
Date: Tue, 10 Mar 1992 18:15:14 GMT

dacrd!desj@uunet.UU.NET (David desJardins) writes:

>> Maybe I'm just overly used to FORTRAN, but I see a lot of code
>> where unaligned array slices or odd-size columns get passed.
>People who really care about performance are going to write their code on
>the basis of what performs well. Just as on machines with multiple memory
>banks serious users avoid power-of-two strides, on machines with a
>substantial performance penalty for unaligned access serious users can
>avoid unaligned slices.

Perhaps they _can_, but I claim they don't.

Imagine the following chunk of Fortran

do J = 1, L
call SGEMV(M, N, A, IA, B(J, 1), IB, C(1, J), 1, JB)

I just copied this out of a chunk of real code, written by people who are
seriously concerned about performance. And I don't think there's much
wrong with it; I didn't choose it because it's an example of bad code!

But the argument C(1, J) is specifying a column in a matrix. Is the
column aligned to double words? You can't tell unless you know the length
of C's 1st dimension.

I expect that in a fair percentage of the cases, C will be declared to
have an odd-sized 1st dimension. Not because the programmer using the
library was stupid, but because that was his problem size.

Also consider the argument B(J, 1). As it happens, it's specifying the
beginning of a row, but other example could be found (particularly code
manipulating triangular matrices) where ste starting location of a
(partial) column is specified is a similar fashion.

Every other call will have B(J, 1) pointing to an unaligned location.

You may not think much of Fortran; but if some suggested compilation
technique is too hard for Fortran, it's probably outrageous for any other

Preston Briggs

Post a followup to this message

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