Xref: utzoo comp.arch:6456 comp.lang.c:13086 comp.lang.misc:1952 Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!purdue!mailrus!cornell!uw-beaver!uw-june!pardo From: pardo@june.cs.washington.edu (David Keppel) Newsgroups: comp.arch,comp.lang.c,comp.lang.misc Subject: Re: Machine-independent intermediate languages Summary: All optimizations are machine-dependent? Message-ID: <5932@june.cs.washington.edu> Date: 4 Oct 88 16:58:53 GMT References: <853@goofy.megatest.UUCP> Reply-To: pardo@cs.washington.edu (David Keppel) Organization: U of Washington, Computer Science, Seattle Lines: 33 djones@goofy.megatest.UUCP (Dave Jones) writes: >[ the HIIL compiler should(n't)... ] Uh, great, now we have: HLL, HIIL, MIIL. What's HIIL? >[ global optimizations are machine-independent ] I think that there are probably a *lot* of global optimizations that *are* machine dependent. Proof by authority: William Wulf said so. Proof by trivialization: certain global variables may have their concrete type assigned based on machine depndencies, and these in turn will affect local computation; the concrete type assignment may in some cases be available only after certain kinds of global analysis[*]. Eventually you take a hit. [*] Consider a language that supports two types of integers, a hardware-supported type and an arbitrary-precision type. The variable may be declared with values outside the hardware type for some machines, inside the hardware type for other machines. Even knowing whether the *declaration* fits may not be enough. If the declaration doesn't fit the machine type and the *usage* is always within the machine type (which may be determined in at least some cases by looking at every assignment to the variable), then failure to do this (machine-dependent) global optimization will cause the compiler to allocate the arbitrary-preciesion type, which will generally be far less efficient. ;-D on ( Suboptimal reality ) Pardo -- pardo@cs.washington.edu {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo