<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 - SelectionDAGBuilder produces vector nodes without vector support (results in crash)"
   href="https://bugs.llvm.org/show_bug.cgi?id=32481">32481</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SelectionDAGBuilder produces vector nodes without vector support (results in crash)
          </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>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>Common Code Generator Code
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>paulsson@linux.vnet.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18201" name="attach_18201" title="reduced test case">attachment 18201</a> <a href="attachment.cgi?id=18201&action=edit" title="reduced test case">[details]</a></span>
reduced test case

A small test case that includes the type <1 x i8>, causes SelectionDAG to crash
on an older subtarget which does not have vector support.

Should this vector type with one element not be converted to i8 during
SelectionDAG construction, if the target has no vector support? Or is target
required to handle also these types of vector values regardless of vector
support?

Initial selection DAG: BB#1 'autogen_SD18500:CF244'
SelectionDAG has 24 nodes:
  t0: ch = EntryToken
  t16: f32 = ConstantFP<5.720826e-10>
  t17: f32 = ConstantFP<1.107380e+14>
  t18: ch = setune
            t3: i1 = setcc undef:i1, undef:i1, setule:ch
                  t5: i32,ch = CopyFromReg t0, Register:i32 %vreg0
                t7: i32 = AssertSext t5, ValueType:ch:i8
              t8: i8 = truncate t7
            t9: v1i8 = BUILD_VECTOR t8
          t11: v1i8 = select t3, t9, undef:v1i8
        t13: i32 = extract_vector_elt t11, Constant:i32<0>
      t15: ch = CopyToReg t0, Register:i32 %vreg1, t13
    t21: ch = brcond t15, Constant:i1<-1>, BasicBlock:ch<CF244 0x58627f8>
  t23: ch = br t21, BasicBlock:ch<CF241.preheader 0x58628a8>

The SystemZ target then tries to emit an illegal truncate, as it was not
expecting this for zEC12.

Run with
bin/llc -mtriple=s390x-linux-gnu -mcpu=zEC12

(zEC12 is the previous version, which did not have vector support.)</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>