<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 - [X86] Bug in shuffle-to-zero-extend transformation"
   href="https://bugs.llvm.org/show_bug.cgi?id=34576">34576</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[X86] Bug in shuffle-to-zero-extend transformation
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ayman.musa@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>X86ISD::VZEXT node is defined to work on integer types only.

In the following IR code:

define internal fastcc <4 x float> @test(<4 x float> %inp) #0 {
entry:
  %shuf = shufflevector <4 x float> %inp, <4 x float> zeroinitializer, <4 x
i32> <i32 0, i32 undef, i32 2, i32 4>
  ret <4 x float> %shuf
}

the input for the shufflevector instruction should be bitcasted to integer type
before feeding it to zero-extend.

<span class="quote">> ../../build/bin/llc -mattr=+avx2 test.ll -o test.s</span >

LLVM ERROR: Cannot select: t502: v4i64 = X86ISD::VZEXT t501
  t501: v4f32 = bitcast t500
    t500: v2f64 = extract_subvector t466, Constant:i64<0>
      t466: v4f64 = X86ISD::VPERMI t428, Constant:i8<-58>
        t428: v4f64 = bitcast t433
          t433: v8f32 = X86ISD::VPERMILPI t27, Constant:i8<108>
            t27: v8f32,ch = load<LD32[FixedStack-5]> t0, FrameIndex:i64<-5>,
undef:i64
              t26: i64 = FrameIndex<-5>
              t18: i64 = undef
            t432: i8 = Constant<108>
        t465: i8 = Constant<-58>
      t411: i64 = Constant<0>
In function: test</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>