Browse Prior Art Database

Object Code Optimization of Shared Objects on AIX

IP.com Disclosure Number: IPCOM000118078D
Original Publication Date: 1996-Sep-01
Included in the Prior Art Database: 2005-Mar-31
Document File: 2 page(s) / 107K

Publishing Venue

IBM

Related People

Bernstein, D: AUTHOR [+2]

Abstract

A technique currently available for optimizing computer programs on computers running under the AIX* operating system is Feedback Directed Program Restructuring (FDPR).

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

Object Code Optimization of Shared Objects on AIX

      A technique currently available for optimizing computer
programs on computers running under the AIX* operating system is
Feedback Directed Program Restructuring (FDPR).

      Unlike optimizations which take place in the compiler, FDPR is
capable of optimizing programs which have already been compiled and
linked, but not stripped (stripping is a process of removing the
symbol table information from the executable program file.  FDPR uses
profile information collected by running the program on a sample
input for improving the program's code locality and reducing its
branch penalty.

      FDPR has the options for preparing the program for profiling
(this is called "instrumenting" a program), for invoking the
instrumented program and collecting profiling information, and
optimizing the program  for the input which was used to collect the
profile.

      When a shared object file is used in the creation of an
executable program, it is not included in the program.  Instead,
references to it are created in the loader section of the program,
and stubs for the referenced procedures are created in the text
section.  Shared objects are used mainly to reduce the disk and
memory space used by programs.  Many programs may share the same
shared objects, resulting in reduced disk space and memory usage, and
many software vendors ship their programs in the form of shared
objects.  However, FDPR is currently not capable of instrumenting
shared objects.

      In AIX, it is possible to request the linker to make a "static"
linkage.  In a statically linked program, share objects are treated
like regular objects and are included in the resulting output.  This
property is used in the approach described below to extend FDPR
functionality so  as to provide the capability of optimizing shared
objects on AIX.

      When instrumenting a program, FDPR inserts new instructions to
write an execution profile to a file.  The entry point of the program
is modified to create a file and map it to the program's memory
space.  FDPR decides about the name of the profile file and the
address where it should be mapped.  If a file by the same name
already exists when the program is invoked, it is assumed that it
contains results from  a previous invocation of the same program, and
the new results will be  accumulated in the existing profiling file.

      FDPR allocates a single counter for each edge of the control
flow graph in the program.  Usually, the last instruction in each
basic block is modified to "increment" respective counters in the
profile file.  Depending on the type of the last instruction in a
basic block, FDPR generates a respective code to profile that block.

      The main reason for FDPR's current inability to instrument
shared objects is that an object file does not have a unique entry
point, where a profile file may be generated and mapped.

      Th...