]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/gccint/testsuites/support-for-testing-profile-directed-optimizations.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gccint / testsuites / support-for-testing-profile-directed-optimizations.rst
CommitLineData
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
8Support for testing profile-directed optimizations
9**************************************************
10
11The file :samp:`profopt.exp` provides language-independent support for
12checking correct execution of a test built with profile-directed
13optimization. This testing requires that a test program be built and
14executed twice. The first time it is compiled to generate profile
15data, and the second time it is compiled to use the data that was
16generated during the first execution. The second execution is to
17verify that the test produces the expected results.
18
19To check that the optimization actually generated better code, a
20test can be built and run a third time with normal optimizations to
21verify that the performance is better with the profile-directed
22optimizations. :samp:`profopt.exp` has the beginnings of this kind
23of support.
24
25:samp:`profopt.exp` provides generic support for profile-directed
26optimizations. Each set of tests that uses it provides information
27about 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.