low level optimization
Chris Torek
torek at elf.ee.lbl.gov
Sat Apr 27 23:32:50 AEST 1991
(I have tried to stay out of this, as arguing with Jim Giles is bad for
my disposition---everything he writes seems to me a vicious attack, as
if his postings were little rabid dogs, poised to bite the unwary; but
that is only my opinion. At any rate, regardless of the merits of some
of his points [there are some merits!] I wish to make two comments.)
In article <22687 at lanl.gov> jlg at cochiti.lanl.gov (Jim Giles) writes:
>Only _one_ C implementation has been brought to my attention which
>does [inter-module] analysis _at_all_. This is the MIPS C compiler ...
The MIPS compiler is definitely not the only such, though it may be the
only commercial one. For instance, the Plan 9 compilers do much of
their optimization in the linker; there may be a special flag to
disable this in case the linker's optimizer is broken, but the default
is inter-module optimization. (Indeed, the Plan 9 group have decided
they may have gone too far in that direction, as it takes over 30
seconds to compile the Plan 9 kernel from scratch, and if more of the
optimization were done in the `compiler' part more of it could be done
in parallel. Would that gcc could compile BSD in under a minute, or
even under 10 ... ah well.)
>Finally, as I have pointed out before, I consider the MIPS method
>perfectly acceptable for all but commercial function libraries (which
>are inherently separately compiled so the vendor doesn't have to
>distribute source). ...
Jim seems to be under the impression that in order to get the MIPS
Ucode optimizer to function, you must give it source. This is not the
case. One of the compiler options causes it to emit `.u' files (so
named simply to avoid confusion, no doubt; the only difference between
a .u and a .o file is that the latter contains much more machine code
and much less intermediate information). These .u files can be bound
up in a library. They are not source code (there are no syntax errors
in .u files) and they certainly could be distributed commercially.
They do require more time to load than an equivalent library of MIPS .o
files, which some commercial vendors might view an impossible barrier,
but that would be silly (vendors could distribute both formats, one for
`test compilation' and one for `final compilation', if compilation time
is considered important).
--
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427)
Berkeley, CA Domain: torek at ee.lbl.gov
More information about the Comp.lang.c
mailing list