Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!texsun!convex!metzger From: metzger@convex.com (Robert Metzger) Newsgroups: comp.benchmarks Subject: benchmarks and interprocedural optimization Message-ID: <1991Mar21.184428.8226@convex.com> Date: 21 Mar 91 18:44:28 GMT Sender: news@convex.com (news access account) Organization: Convex Computer Corporation, Richardson, Tx. Lines: 68 Nntp-Posting-Host: bach.convex.com > Article 326 of comp.benchmarks: > Path: convex!texsun!sundc!seismo!dimacs.rutgers.edu!mips!sdd.hp.com!ucsd!ogicse!borasky > Date: 3 Jan 91 15:46:45 GMT > From: borasky@ogicse.ogi.edu (M. Edward Borasky) > Even discounting blatant cheats like the ones I describe above, there > is a wider issue here about how much COMPILE time a user is willing > to expend for "perfect" compiles. It is possible using techniques of > whole-program compiling to optimize out all the unnecessary checks in > the LINPACK benchmark -- it's simple enough and well-structured enough > so that a compiler can "realize" that DAXPY is always called with inc- > rement 1, that the DAXPY can be in-lined, that N is always greater than > zero, that one-trip DO loops will work, etc. But these optimizations > take time -- so much time that on real codes larger than LINPACK, one > of two things will happen: > 1. The user will think the compiler has gone into an endless loop and > zap the compile, or > There ARE users who claim they will tolerate long optimization times; > my experience in Marketing was that such were few and far between. > The main uses for such a compiler are large third-party application > codes that are seldom compiled -- once or twice a year for the ones I > worked with. But the size of these codes works AGAINST the whole- > program compiler! CONVEX's experience with its new Application Compiler (performs interprocedural optimization on codes in written in FORTRAN and/or C) contradicts these assertions. First, properly implemented interprocedural optimization does not take forever. Our experience is that it takes, on average 2-3 times as much CPU time to do interprocedural compilation as procedural compilation. More importantly, the time usually grows linearly, with the size of the application. I will give you one data point. One of the larger applications we have compiled had 214,500 lines of FORTRAN source in 971 source files. It took a total of 5 hours and 26 minutes wall clock time to compile and link on a CONVEX C-2. This is about 660 lines per minute. Of that time, 2 hours and 43 minutes were spent in the interprocedural phase and 32 minutes in the linker. Lots of IP optimizations were performed -- 1576 calls inlined, 1774 constants propagated, etc, etc. Second, our users seem to be quite willing to wait a little longer to get optimizations and diagnostics they can get no other way. We have a lot of users who measure their job runs in DAYS, and they are quite capable of seeing the benefit in spending some extra hours once in a while when they compile in order to save days when they run their jobs every week. To prevent worries about "endless loops" we provide a "verbose" option that tells the user what step it is working as it goes along. Our users are also smart enough to use the right tool for the right job -- they don't use the interprocedural compiler to do syntax checking of newly written code. They do use it for semantic checking of code that supposedly works (being ported from another machine) and for optimization, once the application is fully tested using the existing procedure compilers. One other note: interprocedural optimization will render many industry standard benchmarks meaningless. Those which measure call overhead or depend on procedure calls to keep information from the compiler have already been trashed (like whetstone). -- Robert Metzger CONVEX Computer Corp. Richardson, Texas Generic Disclaimer: I write software, not CONVEX Corporate Policies. "The only legitimate function of government is to protect its citizens from harm or property loss by violence, stealth, or fraud. All else is tyranny."