You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

208 line
9.1KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Regular IPA passes (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Regular IPA passes (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Regular IPA passes (GNU Compiler Collection (GCC) Internals)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="IPA-passes.html#IPA-passes" rel="up" title="IPA passes">
  30. <link href="Late-IPA-passes.html#Late-IPA-passes" rel="next" title="Late IPA passes">
  31. <link href="Small-IPA-passes.html#Small-IPA-passes" rel="prev" title="Small IPA passes">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Regular-IPA-passes"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Late-IPA-passes.html#Late-IPA-passes" accesskey="n" rel="next">Late IPA passes</a>, Previous: <a href="Small-IPA-passes.html#Small-IPA-passes" accesskey="p" rel="prev">Small IPA passes</a>, Up: <a href="IPA-passes.html#IPA-passes" accesskey="u" rel="up">IPA passes</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="Regular-IPA-passes-1"></a>
  68. <h4 class="subsection">9.4.2 Regular IPA passes</h4>
  69. <a name="index-regular-IPA-passes"></a>
  70. <p>A regular IPA pass is a pass derived from <code>ipa_opt_pass_d</code> that
  71. is executed in WHOPR compilation. Regular IPA passes may have summary
  72. hooks implemented in any of the LGEN, WPA or LTRANS stages (see <a href="IPA.html#IPA">IPA</a>).
  73. </p>
  74. <ul>
  75. <li> IPA whole program visibility
  76. <p>This pass performs various optimizations involving symbol visibility
  77. with <samp>-fwhole-program</samp>, including symbol privatization,
  78. discovering local functions, and dismantling comdat groups. It is
  79. located in <samp>ipa-visibility.c</samp> and is described by
  80. <code>pass_ipa_whole_program_visibility</code>.
  81. </p>
  82. </li><li> IPA profile
  83. <p>The IPA profile pass propagates profiling frequencies across the call
  84. graph. It is located in <samp>ipa-profile.c</samp> and is described by
  85. <code>pass_ipa_profile</code>.
  86. </p>
  87. </li><li> IPA identical code folding
  88. <p>This is the inter-procedural identical code folding pass.
  89. The goal of this transformation is to discover functions
  90. and read-only variables that have exactly the same semantics. It is
  91. located in <samp>ipa-icf.c</samp> and is described by <code>pass_ipa_icf</code>.
  92. </p>
  93. </li><li> IPA devirtualization
  94. <p>This pass performs speculative devirtualization based on the type
  95. inheritance graph. When a polymorphic call has only one likely target
  96. in the unit, it is turned into a speculative call. It is located in
  97. <samp>ipa-devirt.c</samp> and is described by <code>pass_ipa_devirt</code>.
  98. </p>
  99. </li><li> IPA constant propagation
  100. <p>The goal of this pass is to discover functions that are always invoked
  101. with some arguments with the same known constant values and to modify
  102. the functions accordingly. It can also do partial specialization and
  103. type-based devirtualization. It is located in <samp>ipa-cp.c</samp> and is
  104. described by <code>pass_ipa_cp</code>.
  105. </p>
  106. </li><li> IPA scalar replacement of aggregates
  107. <p>This pass can replace an aggregate parameter with a set of other parameters
  108. representing part of the original, turning those passed by reference
  109. into new ones which pass the value directly. It also removes unused
  110. function return values and unused function parameters. This pass is
  111. located in <samp>ipa-sra.c</samp> and is described by <code>pass_ipa_sra</code>.
  112. </p>
  113. </li><li> IPA constructor/destructor merge
  114. <p>This pass merges multiple constructors and destructors for static
  115. objects into single functions. It&rsquo;s only run at LTO time unless the
  116. target doesn&rsquo;t support constructors and destructors natively. The
  117. pass is located in <samp>ipa.c</samp> and is described by
  118. <code>pass_ipa_cdtor_merge</code>.
  119. </p>
  120. </li><li> IPA HSA
  121. <p>This pass is part of the GCC support for HSA (Heterogeneous System
  122. Architecture) accelerators. It is responsible for creation of HSA
  123. clones and emitting HSAIL instructions for them. It is located in
  124. <samp>ipa-hsa.c</samp> and is described by <code>pass_ipa_hsa</code>.
  125. </p>
  126. </li><li> IPA function summary
  127. <p>This pass provides function analysis for inter-procedural passes.
  128. It collects estimates of function body size, execution time, and frame
  129. size for each function. It also estimates information about function
  130. calls: call statement size, time and how often the parameters change
  131. for each call. It is located in <samp>ipa-fnsummary.c</samp> and is
  132. described by <code>pass_ipa_fn_summary</code>.
  133. </p>
  134. </li><li> IPA inline
  135. <p>The IPA inline pass handles function inlining with whole-program
  136. knowledge. Small functions that are candidates for inlining are
  137. ordered in increasing badness, bounded by unit growth parameters.
  138. Unreachable functions are removed from the call graph. Functions called
  139. once and not exported from the unit are inlined. This pass is located in
  140. <samp>ipa-inline.c</samp> and is described by <code>pass_ipa_inline</code>.
  141. </p>
  142. </li><li> IPA pure/const analysis
  143. <p>This pass marks functions as being either const (<code>TREE_READONLY</code>) or
  144. pure (<code>DECL_PURE_P</code>). The per-function information is produced
  145. by <code>pure_const_generate_summary</code>, then the global information is computed
  146. by performing a transitive closure over the call graph. It is located in
  147. <samp>ipa-pure-const.c</samp> and is described by <code>pass_ipa_pure_const</code>.
  148. </p>
  149. </li><li> IPA free function summary
  150. <p>This pass is a regular IPA pass when argument <code>small_p</code> is false.
  151. It releases inline function summaries and call summaries.
  152. It is located in <samp>ipa-fnsummary.c</samp> and is described by
  153. <code>pass_ipa_free_fn_summary</code>.
  154. </p>
  155. </li><li> IPA reference
  156. <p>This pass gathers information about how variables whose scope is
  157. confined to the compilation unit are used. It is located in
  158. <samp>ipa-reference.c</samp> and is described by <code>pass_ipa_reference</code>.
  159. </p>
  160. </li><li> IPA single use
  161. <p>This pass checks whether variables are used by a single function.
  162. It is located in <samp>ipa.c</samp> and is described by
  163. <code>pass_ipa_single_use</code>.
  164. </p>
  165. </li><li> IPA comdats
  166. <p>This pass looks for static symbols that are used exclusively
  167. within one comdat group, and moves them into that comdat group. It is
  168. located in <samp>ipa-comdats.c</samp> and is described by
  169. <code>pass_ipa_comdats</code>.
  170. </p>
  171. </li></ul>
  172. <hr>
  173. <div class="header">
  174. <p>
  175. Next: <a href="Late-IPA-passes.html#Late-IPA-passes" accesskey="n" rel="next">Late IPA passes</a>, Previous: <a href="Small-IPA-passes.html#Small-IPA-passes" accesskey="p" rel="prev">Small IPA passes</a>, Up: <a href="IPA-passes.html#IPA-passes" accesskey="u" rel="up">IPA passes</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  176. </div>
  177. </body>
  178. </html>