<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:jirislaby@gmail.com" title="Jiri Slaby <jirislaby@gmail.com>"> <span class="fn">Jiri Slaby</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - opt is defunct when code built without optimizations"
   href="https://bugs.llvm.org/show_bug.cgi?id=35950">bug 35950</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>INVALID
           </td>
           <td>---
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>c.cadar@imperial.ac.uk, dan@su-root.co.uk
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>RESOLVED
           </td>
           <td>REOPENED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - opt is defunct when code built without optimizations"
   href="https://bugs.llvm.org/show_bug.cgi?id=35950#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - opt is defunct when code built without optimizations"
   href="https://bugs.llvm.org/show_bug.cgi?id=35950">bug 35950</a>
              from <span class="vcard"><a class="email" href="mailto:jirislaby@gmail.com" title="Jiri Slaby <jirislaby@gmail.com>"> <span class="fn">Jiri Slaby</span></a>
</span></b>
        <pre>(In reply to David Blaikie from <a href="show_bug.cgi?id=35950#c1">comment #1</a>)
<span class="quote">> This behavior is intentional.

> -O0 IR carries with it that contract that it should not be optimized - so
> opt satisfies that request by running the optimization passes, but they all
> do nothing to modify -O0 IR.

> This is important when preserving the semantic request of -O0 in IR that is
> merged from multiple other IR files, some of which may be compiled with -O0
> and some with optimizations enabled.</span >

Hmm, that is not nice and even incorrect. If somebody wants such behaviour,
introduce a new compiler option and do not abuse -O0. Or introduce an option to
disable this new behaviour. -O0 is even implicit -- users do not actually
"disable" optimizations, they just do not enable any. And even if they do -O0,
that does not necessarily mean they do not want to optimize later.

The problem with the current approach is that many users do not optimize during
compilation, but optimize the code in runtime (via PassManagers) and multiple
times in different ways. Klee is one of the examples. And given this behaviour
changed in clang 5, klee is unable to optimize, so this is clearly a
regression.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>