<html>
    <head>
      <base href="https://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 --- - Error in backend: Cannot select: t57: v2i64 = zero_extend_vector_inreg t61"
   href="https://llvm.org/bugs/show_bug.cgi?id=31593">31593</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Error in backend: Cannot select: t57: v2i64 = zero_extend_vector_inreg t61
          </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>douglas_yung@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Starting with r291120, we started to see this error in one of our tests when
the compiler is targeting the PS4 platform with -O2 or higher.

To reproduce the failure, compile the following code with -O2 or higher and
targeting the PS4 (--target=x86_64-scei-ps4):

typedef int __v4si __attribute__((__vector_size__(16)));
typedef long long __m128i __attribute__((__vector_size__(16)));
struct S {
  typedef S &SR;
  int a() const;
  void b(SR a, SR b);
  void c(SR a, int t);
  void d(SR a, SR b);
  __m128i m_quad;
};
int S::a() const {
  return ({
    __v4si __a = (m_quad);
    __a[0];
  });
}
void S::c(SR a, int t) {
  m_quad = __builtin_ia32_pslldi128(m_quad, t);
}
void foo() {
  S zero;
  int t;
  S e;
  e.d(e, zero);
  t = e.a();
  S s;
  s.c(e, t);
  S u;
  S f;
  f.b(u, s);
}

When compiled with a compiler built from r291120 and targeting the PS4 using
-O2, I get the following error:

fatal error: error in backend: Cannot select: t57: v2i64 =
zero_extend_vector_inreg t61
  t61: v4i32 = bitcast t60
    t60: v2i64,ch = load<LD16[%3](tbaa=<0x2504c38>)(dereferenceable)> t24,
FrameIndex:i64<2>, undef:i64
      t9: i64 = FrameIndex<2>
      t2: i64 = undef
In function: _Z3foov
clang.exe: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 4.0.0 (trunk 291120)
Target: x86_64-scei-ps4
Thread model: posix
InstalledDir: c:\src\upstream\291120\Release\bin</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>