<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:spatel+llvm@rotateright.com" title="Sanjay Patel &lt;spatel+llvm&#64;rotateright.com&gt;"> <span class="fn">Sanjay Patel</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_REOPENED " title="REOPENED --- - bad generated code for conditionals connected by (&amp;)" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23827&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=kbLe7BNhHcath0g_GjGhEpyuXl6N_UEKEU5OL2K-3Nk&s=xl5MttHTPXfVPh6iltbfFQwnxoaF_0EdZ2nBYecpIAU&e=">bug 23827</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;">Status</td>
           <td>RESOLVED
           </td>
           <td>REOPENED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>INVALID
           </td>
           <td>---
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED " title="REOPENED --- - bad generated code for conditionals connected by (&amp;)" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23827-23c10&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=kbLe7BNhHcath0g_GjGhEpyuXl6N_UEKEU5OL2K-3Nk&s=2IesKcxaTbLYMXJk4JoVIjkXgQO601d2if17y4Cm2Xo&e=">Comment # 10</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED " title="REOPENED --- - bad generated code for conditionals connected by (&amp;)" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23827&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=kbLe7BNhHcath0g_GjGhEpyuXl6N_UEKEU5OL2K-3Nk&s=xl5MttHTPXfVPh6iltbfFQwnxoaF_0EdZ2nBYecpIAU&e=">bug 23827</a>
              from <span class="vcard"><a class="email" href="mailto:spatel+llvm@rotateright.com" title="Sanjay Patel &lt;spatel+llvm&#64;rotateright.com&gt;"> <span class="fn">Sanjay Patel</span></a>
</span></b>
        <pre>I've attached a test program (test harness in C, actual tests in asm) to check
performance of the current branch optimization that's happening for x86 in the
DAG. To try it out on Linux or Mac:

$ clang 23827_tester.c 23827_tests.s
$ ./a.out

As-is, the test program is modeling this C code:

extern int bar();//{ return 0; }

int foo(int x, int y) {
        if (x != 0 && y != 0) return bar();
        return 1;
}

I used clang to compile that down to asm while toggling the
setJumpIsExpensive() hook.

The 'super' cases are the asm for a bigger compound predicate because the DAG
optimization appears to happily turn any size predicate into multiple branches:

extern int bar();//{ return 0; }

int foo(int w, int x, int y, int z) {
        if (w != 0 && x != 0 && y != 0 && z != 0) return bar();
        return 1;
}</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>