<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - bool != less efficient than bool =="
   href="https://bugs.llvm.org/show_bug.cgi?id=42876">42876</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>bool != less efficient than bool ==
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: RISC-V
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>efriedma@quicinc.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, rofirrim@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>void a(_Bool a, _Bool b, void c()) { if (a==b) c(); }
void a2(_Bool a, _Bool b, void c()) { if (a!=b) c(); }

Build with clang -O2 --target=riscv32.  Output:

a:                                      # @a
# %bb.0:                                # %entry
        addi    sp, sp, -16
        sw      ra, 12(sp)
        bne     a0, a1, .LBB0_2

[...]

a2:                                     # @a2
# %bb.0:                                # %entry
        addi    sp, sp, -16
        sw      ra, 12(sp)
        xor     a0, a0, a1
        addi    a1, zero, 1
        bne     a0, a1, .LBB1_2

Something similar happens on some other targets; on x86 and 32-bit ARM, there's
an extra "cmp".

It looks like something weird is happening in target-independent SelectionDAG;
I haven't tried to dig further.</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>