Download Sun Studio 12 Update 1 Performance Analyzer

Transcript
Annotated Source Code
Also displayed in red are special index lines and other special lines that are not compiler
commentary. For example, as a result of compiler optimization, a special index line might be
created for a function in the object code that does not correspond to code written in any source
file. For details, refer to “Special Lines in the Source, Disassembly and PCs Tabs” on page 190.
Compiler Commentary
Compiler commentary indicates how compiler-optimized code has been generated. Compiler
commentary lines are displayed in blue, to distinguish them from index lines and original
source lines. Various parts of the compiler can incorporate commentary into the executable.
Each comment is associated with a specific line of source code. When the annotated source is
written, the compiler commentary for any source line appears immediately preceding the
source line.
The compiler commentary describes many of the transformations which have been made to the
source code to optimize it. These transformations include loop optimizations, parallelization,
inlining and pipelining. The following shows an example of compiler commentary.
0.
0.
0.
0.
0.
0.
28.
SUBROUTINE dgemv_g2 (transa, m, n, alpha, b, ldb, &
29.
&
c, incc, beta, a, inca)
30.
CHARACTER (KIND=1) :: transa
31.
INTEGER (KIND=4) :: m, n, incc, inca, ldb
32.
REAL
(KIND=8) :: alpha, beta
33.
REAL
(KIND=8) :: a(1:m), b(1:ldb,1:n), c(1:n)
34.
INTEGER
:: i, j
35.
REAL
(KIND=8) :: tmr, wtime, tmrend
36.
COMMON/timer/ tmr
37.
Function wtime_ not inlined because the compiler has not seen
the body of the routine
0.
38.
tmrend = tmr + wtime()
Function wtime_ not inlined because the compiler has not seen
the body of the routine
Discovered loop below has tag L16
0.
39.
DO WHILE(wtime() < tmrend)
0.
0.
0.
0.
0.
0.
0.
0.
0.
0.
Array statement below generated loop L4
0.
40.
a(1:m) = 0.0
41.
Source loop below has tag L6
0.
42.
DO j = 1, n
! <=-----\ swapped loop indices
Source loop below has tag L5
L5 cloned for unrolling-epilog. Clone is L19
Chapter 8 • Understanding Annotated Source and Disassembly Data
181