Understanding Feedback
1-9
Introduction
1.4
Understanding Feedback
The compiler provides some feedback by default. Additional feedback is gen-
erated with the -mw option. The feedback is located in the .asm file that the
compiler generates. In order to view the feedback, you must also enable -k
which retains the .asm output from the compiler. By understanding feedback,
you can quickly tune your C code to obtain the highest possible performance.
The feedback in Example 1–1 is for an innermost loop. On the ’C6000, C code
loop performance is greatly affected by how well the compiler can software
pipeline. The feedback is geared for explaining exactly what all the issues with
pipelining the loop were and what the results obtained were. Understanding
feedback will focus on all the components in the software pipelining feedback
window.
The compiler goes through three basic stages when compiling a loop. Here we
will focus on the comprehension of these stages and the feedback produced
by them. This, combined with the Feedback Solutions in Appendix A will send
you well on your way to fully optimizing your code with the ’C6000 compiler.
The three stages are:
1) Qualify the loop for software pipelining
2) Collect loop resource and dependency graph information
3) Software pipeline the loop
1.4.1
Stage 1: Qualify the Loop for Software Pipelining
The result of this stage will show up as the first three or four lines in the feed-
back window as long as the compiler qualifies the loop for pipelining:
Example 1–2.Stage 1 Feedback
;* Known Minimum Trip Count : 2
;* Known Maximum Trip Count : 2
;* Known Max Trip Count Factor : 2
-
Trip Count. The number of iterations or trips through a loop.
-
Minimum Trip Count. The minimum number of times the loop might exe-
cute given the amount of information available to the compiler.
-
Maximum Trip Count. The maximum number of times the loop might exe-
cute given the amount of information available to the compiler.