<div dir="ltr"><div><div><div>The new PM always runs -latesimplifycfg rather than -simplifycfg. Test to show it:</div><div><a href="https://reviews.llvm.org/rL316351">https://reviews.llvm.org/rL316351</a><br></div><div><br></div></div>Given that these patches cited SPEC and test-suite perf while changing the behavior of simplifycfg:<br><a href="https://reviews.llvm.org/D30333" target="_blank">https://reviews.llvm.org/<wbr>D30333</a><br><a href="https://reviews.llvm.org/D35411" target="_blank">https://reviews.llvm.org/<wbr>D35411</a><br></div><br>...the differences mentioned here might be related?<br><div><br></div><div>Kindly request review so we can close this hole. :)<br><a href="https://reviews.llvm.org/D38631" target="_blank">https://reviews.llvm.org/<wbr>D38631</a><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 25, 2017 at 11:38 AM, Hal Finkel via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><span class="">
    <p><br>
    </p>
    <div class="m_-4817903684469738406moz-cite-prefix">On 10/25/2017 12:32 PM, Evgeny
      Astigeevich wrote:<br>
    </div>
    <blockquote type="cite">
      
      
      
      
      
      <div class="m_-4817903684469738406WordSection1">
        <p class="MsoNormal"><span>Hi
            Hal,<u></u><u></u></span></p>
        <p class="MsoNormal"><span><u></u> <u></u></span></p>
        <p class="MsoNormal"><span>I
            quickly checked the execution profile. It is real. The code
            changed significantly. A number of the hottest regions
            changed. I’ll compare IRs.</span></p>
      </div>
    </blockquote>
    <br></span>
    Thanks. Obviously a 1000% execution performance regression seems
    problematic.<br>
    <br>
     -Hal<div><div class="h5"><br>
    <br>
    <blockquote type="cite">
      <div class="m_-4817903684469738406WordSection1">
        <p class="MsoNormal"><span><u></u><u></u></span></p>
        <p class="MsoNormal"><span>JFYI
            FreeBench/fourinarow  time graph:
            <a href="http://lnt.llvm.org/db_default/v4/nts/graph?highlight_run=76922&plot.1604615=1349.1604615.3" target="_blank">http://lnt.llvm.org/db_<wbr>default/v4/nts/graph?<wbr>highlight_run=76922&plot.<wbr>1604615=1349.1604615.3</a>
            <u></u><u></u></span></p>
        <p class="MsoNormal"><span>Its
            graph in our LNT is more stable.<u></u><u></u></span></p>
        <p class="MsoNormal"><span><u></u> <u></u></span></p>
        <p class="MsoNormal"><span>Thanks,<u></u><u></u></span></p>
        <p class="MsoNormal"><span>Evgeny<u></u><u></u></span></p>
        <p class="MsoNormal"><span><u></u> <u></u></span></p>
        <div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
          <p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Hal Finkel
              <a class="m_-4817903684469738406moz-txt-link-rfc2396E" href="mailto:hfinkel@anl.gov" target="_blank"><hfinkel@anl.gov></a><br>
              <b>Organization: </b>Argonne National Laboratory<br>
              <b>Date: </b>Wednesday, 25 October 2017 at 18:14<br>
              <b>To: </b>Evgeny Astigeevich
              <a class="m_-4817903684469738406moz-txt-link-rfc2396E" href="mailto:Evgeny.Astigeevich@arm.com" target="_blank"><Evgeny.Astigeevich@arm.com></a>, Chandler Carruth
              <a class="m_-4817903684469738406moz-txt-link-rfc2396E" href="mailto:chandlerc@gmail.com" target="_blank"><chandlerc@gmail.com></a><br>
              <b>Cc: </b>llvm-dev <a class="m_-4817903684469738406moz-txt-link-rfc2396E" href="mailto:llvm-dev@lists.llvm.org" target="_blank"><llvm-dev@lists.llvm.org></a>, nd
              <a class="m_-4817903684469738406moz-txt-link-rfc2396E" href="mailto:nd@arm.com" target="_blank"><nd@arm.com></a><br>
              <b>Subject: </b>Re: [llvm-dev] RFC: Switching to the new
              pass manager by default<u></u><u></u></span></p>
        </div>
        <div>
          <p class="MsoNormal"><u></u> <u></u></p>
        </div>
        <p><u></u> <u></u></p>
        <div>
          <p class="MsoNormal">On 10/25/2017 12:10 PM, Evgeny
            Astigeevich via llvm-dev wrote:<u></u><u></u></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span>Hi
              Chandler,</span><u></u><u></u></p>
          <p class="MsoNormal"><span> </span><u></u><u></u></p>
          <p class="MsoNormal"><span>I
              ran the LNT benchmarks and SPEC2k6.train on AArch64
              Cortex-A57. I used revisions: Clang 316561, LLVM 316563.</span><u></u><u></u></p>
          <p class="MsoNormal"><span>Options:
              -O3 -mcpu=cortex-a57 -fomit-frame-pointer
              -fexperimental-new-pass-<wbr>manager</span><u></u><u></u></p>
          <p class="MsoNormal"><span> </span><u></u><u></u></p>
          <p class="MsoNormal"><span>Regressions:
              execution time increase</span><u></u><u></u></p>
          <p class="MsoNormal"><span> </span><u></u><u></u></p>
          <p class="MsoNormal"><span>LNT</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Benchmarks/<wbr>FreeBench/fourinarow/<wbr>fourinarow                    <wbr>         
              1018.58%</span><u></u><u></u></p>
        </blockquote>
        <p class="MsoNormal"><br>
          How real is this?<br>
          <br>
           -Hal<br>
          <br>
          <br>
          <u></u><u></u></p>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span>MultiSource/Benchmarks/<wbr>Fhourstones/fhourstones       <wbr>         
                                            <wbr>  9.06%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Benchmarks/<wbr>Ptrdist/yacr2/yacr2           <wbr>               
                                            <wbr>  7.23%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Benchmarks/Olden/<wbr>perimeter/perimeter          
                                            <wbr>  6.87%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Benchmarks/<wbr>MiBench/consumer-typeset/<wbr>consumer-typeset       
              6.02%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Benchmarks/<wbr>Trimaran/enc-pc1/enc-pc1      <wbr>      
                                            <wbr>  5.59%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Benchmarks/ASC_<wbr>Sequoia/AMGmk/AMGmk    
                                              5.03%</span><u></u><u></u></p>
          <p class="MsoNormal"><span> </span><u></u><u></u></p>
          <p class="MsoNormal"><span>SPEC2k6</span><u></u><u></u></p>
          <p class="MsoNormal"><span>453.povray          
              17.11%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>482.sphinx3         
              3.44%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>444.namd            
              2.89%</span><u></u><u></u></p>
          <p class="MsoNormal"><span> </span><u></u><u></u></p>
          <p class="MsoNormal"><span>Improvements:
              execution time decrease</span><u></u><u></u></p>
          <p class="MsoNormal"><span> </span><u></u><u></u></p>
          <p class="MsoNormal"><span>LNT</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Benchmarks/<wbr>BitBench/uudecode/uudecode    <wbr> 
                              -50.90%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>SingleSource/Benchmarks/Adobe-<wbr>C++/loop_unroll  
                                            <wbr>  -27.75%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>SingleSource/Benchmarks/Misc/<wbr>perlin        
                                            <wbr>                  -21.35%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Benchmarks/Olden/<wbr>em3d/em3d          
                                            <wbr>  -19.12%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Benchmarks/<wbr>tramp3d-v4/tramp3d-v4
                                            <wbr>  -8.58%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>SingleSource/Benchmarks/<wbr>McGill/chomp   
                                            <wbr>                  -6.33%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Benchmarks/sim/sim
                              <wbr>                              <wbr>    -5.41%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Applications/<wbr>ClamAV/clamscan             
                                            <wbr>  -3.11%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>MultiSource/Benchmarks/TSVC/<wbr>Symbolics-dbl/Symbolics-dbl
                              -2.81%</span><u></u><u></u></p>
          <p class="MsoNormal"><span> </span><u></u><u></u></p>
          <p class="MsoNormal"><span>SPEC2k6</span><u></u><u></u></p>
          <p class="MsoNormal"><span>429.mcf                
              -5.18%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>473.astar             
              -2.65%</span><u></u><u></u></p>
          <p class="MsoNormal"><span>400.perlbench    
              -1.90%</span><u></u><u></u></p>
          <p class="MsoNormal"><span> </span><u></u><u></u></p>
          <p class="MsoNormal"><span>There
              are also code sizes increases/decreases. The maximum
              increase is 18.98%. The maximum decrease is 25.65%.</span><u></u><u></u></p>
          <p class="MsoNormal"><span> </span><u></u><u></u></p>
          <p class="MsoNormal"><span>Thanks,</span><u></u><u></u></p>
          <p class="MsoNormal"><span>Evgeny
              Astigeevich</span><u></u><u></u></p>
          <p class="MsoNormal"><span> </span><u></u><u></u></p>
          <div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">llvm-dev
                <a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank"><llvm-dev-bounces@lists.llvm.<wbr>org></a>
                on behalf of Chandler Carruth via llvm-dev
                <a href="mailto:llvm-dev@lists.llvm.org" target="_blank"><llvm-dev@lists.llvm.org></a><br>
                <b>Reply-To: </b>Chandler Carruth <a href="mailto:chandlerc@gmail.com" target="_blank"><chandlerc@gmail.com></a><br>
                <b>Date: </b>Wednesday, 18 October 2017 at 07:51<br>
                <b>To: </b>llvm-dev <a href="mailto:llvm-dev@lists.llvm.org" target="_blank"><llvm-dev@lists.llvm.org></a><br>
                <b>Subject: </b>[llvm-dev] RFC: Switching to the new
                pass manager by default</span><u></u><u></u></p>
          </div>
          <div>
            <p class="MsoNormal"> <u></u><u></u></p>
          </div>
          <div>
            <p class="MsoNormal">Greetings everyone! <u></u><u></u></p>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">The new pass manager is getting
                extremely close to the point where I'm not aware of any
                significant outstanding work needed, and I'd like to see
                what else would be needed to enable it by default. Here
                are the current functionality I'm aware of outstanding:<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">1) Does not do non-trivial loop
                unswitching. Majority of this is in
                <a href="https://reviews.llvm.org/D34200" target="_blank">https://reviews.llvm.org/<wbr>D34200</a> but
                will need one or two small follow-ups.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">2) Currently, sanitizers don't work
                correctly with it. Thanks to the work of others, the
                missing infrastructure has been added and I'll send a
                patch to wire this up this week.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">3) Missing support for 'optnone'.
                I've been working on this, but the existing testing
                wasn't as thorough as I wanted, so it is going slowly.
                I've got about 1/4 of this implemented and should have
                patches this week or next.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">4) Missing opt-bisect (or similar)
                facility. This looks pretty trivial to add, but I've not
                even started. If anyone is interested in it, go for it.
                We might even be able to do something simpler using the
                generic debug counters and get equivalent functionality.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">... that's it?<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">Optimization quality / run-time
                performance:<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">- We've been using it at Google
                extensively and are very happy with the optimization
                quality. Benchmarks look *very* good here.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">- More data from other users would be
                important.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">- You can try it out with
                `-fexperimental-new-pass-<wbr>manager` to Clang<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">Compile-time performance:<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">- Sometimes *much* better due to
                cached analyses.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">- Sometimes worse, typically due to
                more / different inlining in turn running main pipeline
                (GVN + InstCombine) more times or over more code.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">- Overall somewhat a wash, but the
                increased compile times typically due to the optimizer
                "trying" harder, so not too concerning on our end.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">- Again, more feedback from other
                users good: `-fexperimental-new-pass-<wbr>manager` to Clang<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">Once the four missing things land,
                I'll also happily work on collecting some of the basics
                on the test-suite and CTMark. But I suspect more "in the
                wild" data would really be useful here given the
                significance of the change.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">Thoughts? What else (beyond the four
                items above and feedback on run-time and compile-time)
                would folks like to see?<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">Once this happens, I'll also be
                preparing some batch, mechanical updates to the test
                suite to primarily use the new pass manager. Also there
                is lots of documentation updates that will be needed
                here.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">-Chandler<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal"> <u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal">PS: I'll be sending a note to cfe-dev
                as a "heads up" about this discussion as in some ways,
                the default flip is mostly a Clang default flip. But
                hopefully our doc updates will trigger this being
                "perceived" as the default for other frontends, and I'll
                try to reach out to other major frontends as well (Swift
                and Rust are on my radar, and I've already started
                talking with Philip Reames about their Falcon JIT).<u></u><u></u></p>
            </div>
          </div>
          <p class="MsoNormal"><br>
            <br>
            <br>
            <u></u><u></u></p>
          <pre>______________________________<wbr>_________________<u></u><u></u></pre>
          <pre>LLVM Developers mailing list<u></u><u></u></pre>
          <pre><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><u></u><u></u></pre>
          <pre><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><u></u><u></u></pre>
        </blockquote>
        <p class="MsoNormal"><br>
          <br>
          <u></u><u></u></p>
        <pre>-- <u></u><u></u></pre>
        <pre>Hal Finkel<u></u><u></u></pre>
        <pre>Lead, Compiler Technology and Programming Languages<u></u><u></u></pre>
        <pre>Leadership Computing Facility<u></u><u></u></pre>
        <pre>Argonne National Laboratory<u></u><u></u></pre>
      </div>
    </blockquote>
    <br>
    <pre class="m_-4817903684469738406moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
  </div></div></div>

<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>