Lesson 4: Program Level Optimization
Example 2–13. Profile Statistics
Location
lesson_c.c line 27
lesson_c.c line 36
lesson1_c.c line 37
lesson2_c.c line 39
lesson3_c.c line 44
lesson1_c.c line 27
lesson2_c.c line 29
lesson3_c.c line 35
Table 2–4. Status Update: Tutorial example lesson_c lesson1_c lesson2_c lesson3_c
Tutorial Example
Potential pointer aliasing info (discussed in Les-
son 1)
Loop count info – minimum trip count (discussed
in Lesson 2)
Loop count info – max trip count factor (dis-
cussed in Lesson 2)
Alignment info – xptr & yptr aligned on a word
boundary (discussed in Lesson 3)
Cycles per iteration (discussed in Lesson 1–3)
Cycles per iteration with program level optimiza-
tion (discussed in Lesson 4)
2-24
Count
Average
1
5020.0
1
60.0
1
60.0
1
60.0
1
60.0
1
12.0
1
12.0
1
12.0
This is quite a performance improvement. The compiler automatically extracts
and acts upon all the information that we passed in Lessons 1 to 3. Even the
original untouched tutor1 is 100% optimized by discounting memory depen-
dencies, unrolling, and performing packed data optimization.
This tutorial has shown you that a lot can be accomplished by both tuning your
C code and using program level optimization. Many different types of tuning
optimizations can be done in addition to what was presented here.
We recommend you use Appendix A, Feedback Solutions, when tuning your
code to get "how to" answers on all of your optimizing C questions. You can
also use the Feedback Solutions Appendix as a tool during development. We
believe this offers a significant advantage to TI customers and we plan on con-
tinuing to drive a more developer–friendly environment in our future releases.
Total
Maximum
Minimum
5020
5020
60
60
60
60
60
60
60
60
12
12
12
12
12
12
Lesson_c
Lesson1_c
p
10
2
1
1
5020
60
60
60
60
12
12
12
Lesson2_c
Lesson3_c
p
p
p
p
p
p
p
1.5
1
1
1
Need help?
Do you have a question about the TMS320C6000 and is the answer not in the manual?
Questions and answers