Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 exptools 1/6/84; site ihuxl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!ihuxl!dcn From: dcn@ihuxl.UUCP (Dave Newkirk) Newsgroups: net.lang.c Subject: Language Independent Code Optimization? Message-ID: <982@ihuxl.UUCP> Date: Thu, 15-Mar-84 12:32:43 EST Article-I.D.: ihuxl.982 Posted: Thu Mar 15 12:32:43 1984 Date-Received: Fri, 16-Mar-84 02:05:11 EST Organization: AT&T Bell Labs, Naperville, IL Lines: 11 There are at least two methods of code optimization I know of that are independent of language design. At the high level there is constant folding, which depends on constants really being constant. Since C doesn't have a constant declaration like Pascal, this would be limited to alphanumeric constants. At the low level is the peephole optimizer, which looks at the code generated by the compiler and tries to do some optimization within a variable 'window' of instructions. If the window is large, more complex optimizations can be performed, but at a slower rate. This can simplify some of the code that would be difficult to untangle at compile time. Dave Newkirk, ihnp4!ihuxl!dcn