This chapter describes the types of information available in the optional PCA listing, and the classes of messages that PCA produces. To help you determine PCA's status and efficiency, use the –listoptions= option to list the optimizations PCA performed. For example, in some cases PCA may tell you that it could have converted any of three loops to concurrent execution but that it converted only the one it considered most profitable.
At times PCA may not convert a loop to concurrent execution because the loop does so little work that it is not worth the small overhead of parallel execution. Because these changes can produce correct but unexpected code, PCA puts a note in the listing to explain its output.
PCA does not produce a listing file unless you request it.
The –listoptions= command-line option tells PCA what information to include in the listing and error files. The listing file can contain any combination of options.
Each listoptions option is summarized in Table 8-1.
Table 8-1. Listing File Options
Value | Description |
|---|---|
c | Print the Calling Tree of the entire program. |
i | Insert line numbers in the transformed code referencing line numbers of the original. |
k | Print PCA options used at the end of the listing. |
l | Print the loop-by-loop optimization table. |
n | Print program unit names, as processed, in the error file. |
p | Print the analysis performance statistics. |
s | Summarize loop optimizations. |
You can enter multiple arguments on the command line; separate each with a comma. The following subsections describe the arguments to –listoptions.
PCA lists the calling tree after all program units have been compiled. The program unit information for each calling tree consists of the functions it calls and the routines where that program unit itself is called. An example follows.
CALLING TREE
line# routines at nest max. aggregate nest
1 function example_9_1_1
6 call mkcoef 0 0
8 call yval 1 0
11 call printf 1 0
18 function mkcoef
26 function yval
34 call sin 1 0
example_9_1_1
mkcoef
yval
sin
printf
CODE MODULES
example_9_1_1 called from
mkcoef called from example_9_1_1
printf called from example_9_1_1
sin called from yval
yval called from example_9_1_1
|
The –listoptions=i switch directs PCA to insert line number references into the transformed code. The line number indicates that the labeled line is either the same as that line in the original code or is derived from it. These make relating constructs in the original and transformed codes easier. In the unrolled loop that follows, the for in the original code was on line 7, and the assignment was on line 8.
# 1 "example_9_1_2.c"
int a[];
# 1 "example_9_1_2.c"
int b[];
# 1 "example_9_1_2.c"
int n;
# 2 "example_9_1_2.c"
void example_9_1_2( )
{
# 4 "example_9_1_2.c"
int i;
int _Kii1;
# 5 "example_9_1_2.c"
_Kii1 = (n)%(3);
# 5 "example_9_1_2.c"
for ( i = 0; i<_Kii1; i++ ) {
a[i] = b[i] / a[i-1];
}
# 5 "example_9_1_2.c"
for ( i = _Kii1; i<n; i+=3 ) {
a[i] = b[i] / a[i-1];
# 6 "example_9_1_2.c"
a[i+1] = b[i+1] / a[i];
# 6 "example_9_1_2.c"
a[i+2] = b[i+2] / a[i+1];
}
}
|
The PCA Options table lists the settings of the command-line options related to optimization that were used for this program unit.
Options Used for this Program Unit ADDRESSRESOLUTION=1 ARCLIMIT=2000 CACHELINE=64 CACHESIZE=64 CMPOPTIONS= CONCURRENTIZEACKV DPREGISTERS=12 EIIFG=20 FPREGISTERS=12 INLINE_DEPTH=2 INLINE_LOOPLEVEL=2 IPA_LOOPLEVEL=2 LIMIT=5000 LINES=55 LISTINGWIDTH=80 MACHINE=S MIIFG=500NO INLINE MINCONCURRENT=1000 NO INLINE_CREATE NO INLINE_FROM_FILE NOINLINE_FROM_LIBRARIES NO INLINE_MANUAL NO IPA NO IPA_CREATE NO IPA_FROM_FILES NO IPA_FROM_LIBRARIES NO IPA_MANUAL OPTIMIZE=5 ROUNDOFF=0 SCALAROPTIMIZE=3 SETASSOCIATIVITY=1 SYNTAX=A UNROLL=4 UNROLL2=100 |
The loop table shows what PCA did with each for loop. If PCA could not optimize the loop, PCA lists the reason.
---------------------------Loop Table--------------------------
Nest
Loop Message Level Contains Lines
===============================================================
for i 1 5-6 "example_9_1_4.c"
Original Loop Split Into Sub-Loops
1. Enhanced Scalar 1 5-6, 8 "example_9_1_4.c"
Line:5 Cleanup loop for loop unrolling.
Line:8 Loop has been fused with others to reduce
overhead.
2. Concurrent & Enhanced Scalar 1 5-6, 8 "example_9_1_4.c"
Line:5 Loop has been fused with others to reduce
overhead.
Line:5 Loop unrolled 4 timestoimprove scalar performance.
for i 1 7-8 "example_9_1_4.c"
|
The program unit names, as processed, are printed in the error file.
FILE: example_9_1_5.c
Function: example_9_1_5
Function: mkcoef
Function: yval
0 errors in file example_9_1_5.c
|
The analysis performance statistics list the number of lines in the program unit, the analysis time in seconds, and the analysis rate in lines per minute. The listing also summarized this information after all program units have been analyzed.
Compilation Statistics For the Routine example_9_1_6
14 Lines in Program Unit
0.29 CPU Time
2896 Lines Per Minute
0 Symbol Cache File Writes
0 Symbol Cache File Reads
0 Source Save File Reads
0 Source Save File Writes
0 Source Save File Opens
0 Name Table File Writes
0 Name Table File Reads
Cumulative Compilation Statistics
15 Lines in Source File
1 Program Units in Source File
0.30 CPU Time
3000 Lines Per Minute
0 Symbol Cache File Writes
0 Symbol Cache File Reads
0 Source Save File Reads
0 Source Save File Writes
0 Source Save File Opens
0 Name Table File Writes
0 Name Table File Reads
|
PCA tries to match the syntax error and warning messages of the compiler with which it runs. A file that would cause the compiler to issue a syntax error should cause PCA to issue a syntax error.
When PCA finds a syntax error, it stops reading the input file after it finishes reading the current function definition. PCA does not send the problem function to the output file, so only code without syntax errors appears in the transformed code file.
When illegal syntax (or any other error) is found, PCA writes a message to standard error. For example, if the code contains an undeclared variable, you get the error:
Error: line 13: file example_9_2.c: idx undefined. PCA -- Syntax Errors Detected |
PCA also writes syntax warning messages to standard error, but optimization proceeds. PCA issues syntax warning messages for constructs that are illegal but whose intent is clear.