<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 12/31/2014 12:49 PM, Tehila Mayzels wrote:<br>
    <blockquote
      cite="mid:080101d0253b$422e4090$c68ac1b0$@cs.technion.ac.il"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <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.</p>
      </div>
    </blockquote>
    To my knowledge, there is not an existing outlining pass in tree. 
    Most of the functionality to write one could probably be found in
    various places, but the profitability heuristics are entirely
    missing.  One reasonable starting point might be the MergeFunctions
    pass.
    <blockquote
      cite="mid:080101d0253b$422e4090$c68ac1b0$@cs.technion.ac.il"
      type="cite">
      <div class="WordSection1">
        <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"><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?</p>
      </div>
    </blockquote>
    This ordering isn't a natural thing to express in LLVM's pass
    structure.  You'll probably need to use a Module pass since that's
    the only type allowed to modify other functions.  (A loop pass will
    not work for this.)<br>
    <br>
    <blockquote
      cite="mid:080101d0253b$422e4090$c68ac1b0$@cs.technion.ac.il"
      type="cite">
      <div class="WordSection1">
        <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">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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>