]>
Commit | Line | Data |
---|---|---|
c63539ff ML |
1 | .. |
2 | Copyright 1988-2022 Free Software Foundation, Inc. | |
3 | This is part of the GCC manual. | |
4 | For copying conditions, see the copyright.rst file. | |
5 | ||
6 | .. _profopt-testing: | |
7 | ||
8 | Support for testing profile-directed optimizations | |
9 | ************************************************** | |
10 | ||
11 | The file :samp:`profopt.exp` provides language-independent support for | |
12 | checking correct execution of a test built with profile-directed | |
13 | optimization. This testing requires that a test program be built and | |
14 | executed twice. The first time it is compiled to generate profile | |
15 | data, and the second time it is compiled to use the data that was | |
16 | generated during the first execution. The second execution is to | |
17 | verify that the test produces the expected results. | |
18 | ||
19 | To check that the optimization actually generated better code, a | |
20 | test can be built and run a third time with normal optimizations to | |
21 | verify that the performance is better with the profile-directed | |
22 | optimizations. :samp:`profopt.exp` has the beginnings of this kind | |
23 | of support. | |
24 | ||
25 | :samp:`profopt.exp` provides generic support for profile-directed | |
26 | optimizations. Each set of tests that uses it provides information | |
27 | about a specific optimization: | |
28 | ||
29 | ``tool`` | |
30 | tool being tested, e.g., :command:`gcc` | |
31 | ||
32 | ``profile_option`` | |
33 | options used to generate profile data | |
34 | ||
35 | ``feedback_option`` | |
36 | options used to optimize using that profile data | |
37 | ||
38 | ``prof_ext`` | |
39 | suffix of profile data files | |
40 | ||
41 | ``PROFOPT_OPTIONS`` | |
42 | list of options with which to run each test, similar to the lists for | |
43 | torture tests | |
44 | ||
45 | :samp:`{ dg-final-generate { {local-directive} } }` | |
46 | This directive is similar to ``dg-final``, but the | |
47 | :samp:`{local-directive}` is run after the generation of profile data. | |
48 | ||
49 | :samp:`{ dg-final-use { {local-directive} } }` | |
50 | The :samp:`{local-directive}` is run after the profile data have been | |
3ed1b4ce | 51 | used. |