EasyManua.ls Logo

Intel i960 - Page 166

Intel i960
347 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Program-wide Analysis and Optimization
4-13
4
Compiling Using the fprof Option
To use the
fprof compiler option to create an instrumented load module:
1. Edit the makefile to add
-fprof to FLAGS.
2. Invoke the make tool without any substitutions, as follows:
make SUBST=
Since the object files depend on the makefile, and the makefile is
edited, the make tool recompiles the modules before linking them:
ic960 -c -Ttarg -fdb -fprof -gcdm,subst=*:*+,iprof= fee.c
ic960 -c -Ttarg -fdb -fprof -gcdm,subst=*:*+,iprof= foo.c
ic960 -o prog -Ttarg -fdb -fprof -gcdm,subst=*:*+,iprof=
fee.o foo.o
Since the substitution option list is empty, there are no substitutions, and
the instrumented modules from the current working directory are linked.
Note that when you use the
fprof option in this manner, the generated
object module contains code that is unsuitable for linking into programs
that are not intended to collect profile information. To solve this problem,
you can use
+fprof with gcdm,subst instead of using fprof when
compiling.
Building an Optimized Program with Profiling
Assuming you have collected a profile named prog.pf by executing the
instrumented version of
prog, you can then use it for program-wide
optimizations by invoking the make tool as follows:
make SUBST=O5 PROF=prog.pf
prog.pf
can be either a raw profile or a self-contained profile. If
prog.pf is a self-contained profile, you can continue to use it as shown
above, even if changes are made to the program.

Table of Contents

Related product manuals