<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 07/05/2017 09:58 AM, Anastasiya
      Ruzhanskaya wrote:<br>
    </div>
    <blockquote
cite="mid:CAH7gUZbKV-vTdGRF=VCo5=K4-SL5TZWHTwp=eC9GALocYL85iA@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <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-<wbr>sqrt-fp-math"="false"
              "disable-tail-calls"="false" "less-precise-fpmad"="false"
              "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-<wbr>leaf"
              "no-infs-fp-math"="false" "no-jump-tables"="false"
              "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="<wbr>false"
              "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>
    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.<br>
    <br>
     -Hal<br>
    <br>
    <blockquote
cite="mid:CAH7gUZbKV-vTdGRF=VCo5=K4-SL5TZWHTwp=eC9GALocYL85iA@mail.gmail.com"
      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 moz-do-not-send="true"
              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_-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 class="">
                  <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_-773001609585264129mimeAttachmentHeader"></fieldset>
                  <br>
                </span>
                <pre>______________________________<wbr>_________________
LLVM Developers mailing list
<a moz-do-not-send="true" class="m_-773001609585264129moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a moz-do-not-send="true" class="m_-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="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    

    <pre class="m_-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="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre></body></html>