low level optimization
Doug Gwyn
gwyn at smoke.brl.mil
Sun Apr 21 05:31:18 AEST 1991
In article <3906 at inews.intel.com> bhoughto at bishop.intel.com (Blair P. Houghton) writes:
>You're so hyped up about the fact that separate compilation
>prevents use of this optimization, but you haven't been
>so vocal about the case where you deliberately alias one
>of your arrays, which also blows your optimization.
Which is one reason why this is not a C-specific issue.
The fact that the Fortran standard prohibits a program from
calling subroutines with arguments that are overlapping array
sections, thereby enabling a certain class of optimizations
(loop vectorization), means that a class of useful program
constructs are also outlawed. Any reasonable language that
supports pointer arguments needs to deal with this issue one
way or another; Fortran came down on the side of restricting
the programmer, while C came down on the side of empowering
the programmer. Due to these stupid "Fortran vs. C" arguments,
C implementors have looked very hard at ways to perform
Fortran-like optimizations for C pointer parameter usage, and
have devised a number of techniques for enabling the
optimization in many circumstances. Cray's Standard C
Compiler release 2.0 is an example of a C compiler that
performs extensive optimization, including loop vectorization.
More information about the Comp.lang.c
mailing list