<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Tehila,<br>
      You can try to use function outlining implemented in clang. It is
      based on class CapturedStmt.<br>
      You can try it with the the following construct:<br>
      <br>
      #pragma clang __debug captured<br>
      <Code to be outlined><br>
      <br>
      Implementation is in clang/lib/Parse/ParsePragma.cpp, StmtResult
      Parser::HandlePragmaCaptured()
      <pre class="moz-signature" cols="72">Best regards,
Alexey Bataev
=============
Software Engineer
Intel Compiler Team
Intel Corp. </pre>
      31.12.2014 23:49, Tehila Mayzels пишет:<br>
    </div>
    <blockquote
      cite="mid:%3C080101d0253b$422e4090$c68ac1b0$@cs.technion.ac.il%3E"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:right;
        direction:rtl;
        unicode-bidi:embed;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:36.0pt;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        text-align:right;
        direction:rtl;
        unicode-bidi:embed;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:223610584;
        mso-list-type:hybrid;
        mso-list-template-ids:-931339658 329416930 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:54.0pt;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:90.0pt;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:126.0pt;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:162.0pt;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:198.0pt;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:234.0pt;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:270.0pt;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:306.0pt;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:342.0pt;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:923027851;
        mso-list-type:hybrid;
        mso-list-template-ids:2117638010 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"
          style="text-align:left;direction:ltr;unicode-bidi:embed">Hi,<o:p></o:p></p>
        <p class="MsoNormal"
          style="text-align:left;direction:ltr;unicode-bidi:embed"><o:p> </o:p></p>
        <p class="MsoNormal"
          style="text-align:left;direction:ltr;unicode-bidi:embed">I
          have some questions regarding outlining (extracting piece of
          code into a function):<o:p></o:p></p>
        <p class="MsoListParagraph"
          style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:54.0pt;margin-bottom:.0001pt;text-align:left;text-indent:-18.0pt;mso-list:l0
          level1 lfo2;direction:ltr;unicode-bidi:embed"><!--[if !supportLists]--><span
            style="mso-list:Ignore">1.<span style="font:7.0pt
              "Times New Roman"">       </span></span><!--[endif]--><span
            dir="LTR"></span>Is there an outlining pass in llvm (IR)?
          I've found out CodeExtractor pass, but I'm not sure it’s
          exactly the same idea.<o:p></o:p></p>
        <p class="MsoListParagraph"
          style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:54.0pt;margin-bottom:.0001pt;text-align:left;text-indent:-18.0pt;mso-list:l0
          level1 lfo2;direction:ltr;unicode-bidi:embed"><!--[if !supportLists]--><span
            style="mso-list:Ignore">2.<span style="font:7.0pt
              "Times New Roman"">       </span></span><!--[endif]--><span
            dir="LTR"></span>How do I set the function name?<o:p></o:p></p>
        <p class="MsoNormal"
          style="text-align:left;direction:ltr;unicode-bidi:embed"><o:p> </o:p></p>
        <p class="MsoNormal"
          style="text-align:left;direction:ltr;unicode-bidi:embed"><o:p> </o:p></p>
        <p class="MsoNormal"
          style="text-align:left;direction:ltr;unicode-bidi:embed">And
          another question:<o:p></o:p></p>
        <p class="MsoNormal"
          style="text-align:left;direction:ltr;unicode-bidi:embed">Where
          do I control the execution of my pass? I'm writing a pass that
          first works on loops, than on a function (outlined from the
          loop) and then again on loops.<o:p></o:p></p>
        <p class="MsoNormal"
          style="text-align:left;direction:ltr;unicode-bidi:embed">How
          can I do that?<o:p></o:p></p>
        <p class="MsoNormal"
          style="text-align:left;direction:ltr;unicode-bidi:embed"><o:p> </o:p></p>
        <p class="MsoNormal"
          style="text-align:left;direction:ltr;unicode-bidi:embed">Thanks
          and happy new year,<o:p></o:p></p>
        <p class="MsoNormal"
          style="text-align:left;direction:ltr;unicode-bidi:embed">Tehila.<o:p></o:p></p>
      </div>
    </blockquote>
    <br>
  </body>
</html>