<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 --- - SDIV >128bit, DAG->DAG error in LegalizeIntegerTypes"
   href="http://llvm.org/bugs/show_bug.cgi?id=17406">17406</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SDIV >128bit, DAG->DAG error in LegalizeIntegerTypes
          </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>Linux
          </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>eda-qa@disemia.com
          </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>I'm getting the following error when trying to SDIV integers greater
than 128bit (on an AMD64 target).

LegalizeIntegerTypes.cpp:2047: void
llvm::DAGTypeLegalizer::ExpandIntRes_SDIV(llvm::SDNode*, llvm::SDValue&,
llvm::SDValue&): Assertion `LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported
SDIV!"' failed.
Stack dump:
0.      Running pass 'X86 DAG->DAG Instruction Selection' on function
'@_entry'

However, not all SDIV on such integers fails, the below works:

@a = global i200 undef
@b = global i64 undef

define void @_entry() {
entry:
  store i200 200, i200* @a
  %0 = load i200* @a
  %1 = load i200* @a
  %2 = sdiv i200 %0, %1
  %3 = trunc i200 %2 to i64
  store i64 %3, i64* @b
  %4 = load i64* @b
  call void @trace_integer(i64 %4)
  ret void
}


Yet with a simple addition (the same SDIV) it fails:

define void @_entry() {
entry:
  store i200 200, i200* @a
  %0 = load i200* @a
  %1 = load i200* @a
  %2 = sdiv i200 %0, %1
  %3 = trunc i200 %2 to i64
  store i64 %3, i64* @b
  %4 = load i200* @a
  %5 = load i200* @a
  %6 = sdiv i200 %4, %5
  store i200 %6, i200* @a
  ret void
}


This is on the LLVM 3.3 release (it also happens on 3.2, the reason I updated).
As it appears all integer sizes are intended to be supported I assume this is a
defect.</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>