<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 8/15/2017 6:43 AM, Vladimir
      Miloserdov via llvm-dev wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:A9FFAF997072EE4384B3F710B41D6311E67C43@DE02WEMBXB.internal.synopsys.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:56.7pt 42.5pt 56.7pt 85.05pt;}
div.WordSection1
        {page:WordSection1;}
--></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">Hello,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I am currently working on optimization
          remarks enhancement (e.g. in loop-vectorize pass). There are 3
          options to enable such diagnostics: -Rpass, -Rpass-missed and
          -Rpass-analysis.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">From help:<o:p></o:p></p>
        <p class="MsoNormal">-Rpass-analysis=<value> Report
          transformation analysis from optimization passes whose name
          matches the given POSIX regular expression<o:p></o:p></p>
        <p class="MsoNormal">-Rpass-missed=<value>   Report missed
          transformations by optimization passes whose name matches the
          given POSIX regular expression<o:p></o:p></p>
        <p class="MsoNormal">-Rpass=<value>          Report
          transformations performed by optimization passes whose name
          matches the given POSIX regular expression<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The question is when to generate “missed”
          remark and when an “analysis” one? In my opinion we should
          generate “missed” remarks with a short explanation why
          optimization did not succeed and “analysis” with additional
          data on optimization process (e.g. “cost of vector
          instructions here is X, cost of scalar version is Y” and so
          on).</p>
      </div>
    </blockquote>
    <br>
    Not sure it's useful to emit the cost of each individual instruction
    (any remark which includes LLVM IR instructions is going to be very
    difficult to understand for anyone who isn't a compiler developer),
    but the intuition is correct, I think.<br>
    <br>
    <blockquote type="cite"
cite="mid:A9FFAF997072EE4384B3F710B41D6311E67C43@DE02WEMBXB.internal.synopsys.com">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Also, this is taken from
          <a class="moz-txt-link-freetext" href="https://reviews.llvm.org/D3683">https://reviews.llvm.org/D3683</a>:<br>
          <span style="font-size:10.0pt;font-family:"Segoe
            UI",sans-serif;color:black">-Rpass-missed is used by
            optimizers to inform the user when they tried<br>
            to apply an optimization but couldn't (or wouldn't).<br>
            -Rpass-analysis is used by optimizers to report analysis
            results back<br>
            to the user (e.g., why the transformation could not be
            applied).</span><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Now consider loop vectorization pass. We
          can’t vectorize a loop with a switching statement, so it will
          be informative to give a message like “loop not vectorized:
          loop contains switching statement”. But should this message
          refer to -Rpass-missed or -Rpass-analysis? In current version
          it goes to “analysis”, and if user is using -Rpass-missed
          instead it gives only “loop not vectorized”. What’s the point
          of doing it in that way? “Missed” remark becomes nearly
          useless for users.</p>
      </div>
    </blockquote>
    <br>
    That sounds like a bug.<br>
    <br>
    -Eli<br>
    <pre class="moz-signature" cols="72">-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
  </body>
</html>