Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Page Tuning Compiler Optimization

IP.com Disclosure Number: IPCOM000115916D
Original Publication Date: 1995-Jul-01
Included in the Prior Art Database: 2005-Mar-30
Document File: 2 page(s) / 60K

Publishing Venue

IBM

Related People

Bramnick, A: AUTHOR

Abstract

Disclosed is a method for optimizing the compilation of the IF - THEN - ELSE statement of a programming language, such as C, so that one clause, such as the THEN clause, is optimized at the expense of the other, such as the ELSE clause. The resulting program can be page tuned so that the mainline, "normal" path runs faster than the exception path. This optimization method, which works best in an environment supporting virtual memory, or paging, may be applied to any high level programming language.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Page Tuning Compiler Optimization

      Disclosed is a method for optimizing the compilation of the IF
- THEN - ELSE statement of a programming language, such as C, so that
one clause, such as the THEN clause, is optimized at the expense of
the other, such as the ELSE clause.  The resulting program can be
page tuned so that the mainline, "normal" path runs faster than the
exception path.  This optimization method, which works best in an
environment supporting virtual memory, or paging, may be applied to
any high level programming language.

      This method requires a programmer to adopt a convention that
all expected (normal) paths through a program take the THEN clause of
an IF statement, while the exceptions (unexpected paths) are
programmed into the ELSE clause of the IF statement.  Then the
compiler, by use of a compiler switch, can collect all the ELSE
clauses at the end of the program, leaving the object code
representing the mainline (expected) path collected together on a set
of memory pages, so that the working set is smaller.

      The usefulness of this method may be understood by considering
the following code fragment example in C:
  if (a<b)
     {
       THEN CLAUSE
     }
  else
     {
       ELSE CLAUSE
     };

      This program might be compiled into the following assembler
code:
  C          a,b          * Compare a to b
  BLE        ELSE1        * If b is less than or equal to a then
                            jump to ELSE1
             then clause  * code for THEN clause
             ...
  B          CONT1        * branch around ELSE1 code and continue
                            program
  ELSE1:     else clause  * code for ELSE clause
             ...
  CONT1                   * continue program

The problem arising in this compilation is that, if the ELSE clause...