<div dir="ltr"><div>Great,<br></div>thank you for your help!<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-07-05 17:06 GMT+02:00 Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span>:<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_3797083560036960419moz-cite-prefix">On 07/05/2017 09:58 AM, Anastasiya
      Ruzhanskaya wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div>Oh, yes...strange<br>
          <code><span style="color:rgb(0,0,0)">attributes </span><span style="color:rgb(136,0,0)">#0 = { noinline nounwind
              optnone uwtable "correctly-rounded-divide-sqrt<wbr>-fp-math"="false"
              "disable-tail-calls"="false" "less-precise-fpmad"="false"
              "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-lea<wbr>f"
              "no-infs-fp-math"="false" "no-jump-tables"="false"
              "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="fal<wbr>se"
              "no-trapping-math"="false" "stack-protector-buffer-size"=<wbr>"8"
              "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,<wbr>+sse,+sse2,+x87"
              "unsafe-fp-math"="false" "use-soft-float"="false" }</span><span style="color:rgb(0,0,0)"></span><span style="color:rgb(0,0,0)"><br>
              <br>
            </span></code></div>
        <code><span style="color:rgb(0,0,0)">How this can be avoided? it
            is always so after clang -s -emit-llvm<br>
          </span></code></div>
    </blockquote>
    <br></span>
    This is because clang defaults to -O0, and in that mode, does not
    produce IR that is intended to be optimized. You probably want to
    do:<br>
    <br>
    clang -S -emit-llvm -O3 -mllvm -disable-llvm-optzns<br>
    <br>
    to get out the unoptimized IR.<span class="HOEnZb"><font color="#888888"><br>
    <br>
     -Hal</font></span><div><div class="h5"><br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div><br>
          <br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2017-07-05 16:49 GMT+02:00 Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span>:<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>
                <p><br>
                </p>
                <div class="m_3797083560036960419m_-773001609585264129moz-cite-prefix">On
                  07/04/2017 04:25 AM, Anastasiya Ruzhanskaya via
                  llvm-dev wrote:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div>
                      <div>
                        <div>
                          <div>
                            <div>
                              <div>
                                <div>Hello,<br>
                                </div>
                                 I am developing now a compiler, based
                                on llvm infrastructure, so I am building
                                my own sequence of llvm passes with some
                                adjustable options. <br>
                                <br>
                              </div>
                              I can't find really clear info about some
                              cases, so maybe you can help, and write:<br>
                              <br>
                            </div>
                            <div>0) Why I should always delete
                              attributes before applying optimizations
                              with opt command? With attributes
                              specified no optimization can be applied.<br>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </blockquote>
                <br>
              </span> You definitely shouldn't delete attributes in
              general. Does your attribute set include optnone?<br>
              <br>
               -Hal<br>
              <br>
              <blockquote type="cite"><span>
                  <div dir="ltr">
                    <div>
                      <div>
                        <div>
                          <div>
                            <div><br>
                            </div>
                            Where I can get real benefit from:<br>
                          </div>
                          1) Constant Hoisting<br>
                        </div>
                        <div>-only when we have some large reusable
                          constants in program?<br>
                        </div>
                        2) argpomotion<br>
                      </div>
                      - this option does not always replace all my args
                      by reerence with values, when I specify it.<br>
                    </div>
                  </div>
                  <br>
                  <fieldset class="m_3797083560036960419m_-773001609585264129mimeAttachmentHeader"></fieldset>
                  <br>
                </span>
                <pre>______________________________<wbr>_________________
LLVM Developers mailing list
<a class="m_3797083560036960419m_-773001609585264129moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a class="m_3797083560036960419m_-773001609585264129moz-txt-link-freetext" 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><span class="m_3797083560036960419HOEnZb"><font color="#888888">
</font></span></pre><span class="m_3797083560036960419HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="m_3797083560036960419HOEnZb"><font color="#888888">
    

    <pre class="m_3797083560036960419m_-773001609585264129moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
  </font></span></div>

</blockquote></div>
</div>



</blockquote>
<pre class="m_3797083560036960419moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre></div></div></div></blockquote></div><br></div>