<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - [thumbv8] insts that sets CPSR are bundled into IT block mistakenly"
   href="http://llvm.org/bugs/show_bug.cgi?id=18370">18370</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[thumbv8] insts that sets CPSR are bundled into IT block mistakenly
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>weimingz@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11812" name="attach_11812" title="test case">attachment 11812</a> <a href="attachment.cgi?id=11812&action=edit" title="test case">[details]</a></span>
test case

llc < test.ll 
emits:
foo:
@ BB#0:                                 @ %entry
    mov    r1, r0
    movs    r0, #11
    cmp    r1, #0
    it    ne
    mulsne    r0, r1, r0  ===> incorrrect: it can't set CPSR inside IT
    bx    lr


Reason:
    Thumbv8 requires running Thumb2SizeReduction pass before IfConv to
    convert wide 32-bit Thumb2 insts to 16-bit narrow insts becuase wide
    insts are not eligible for IT blocks. However, Thumb2SizeReduction may
    also set CPSR for converted instrs (e.g. mul -> muls). However, such
    insts should not be bundled.</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>