<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 - [GISEL] Error legalising neon type at -O0 on AArch64."
   href="https://bugs.llvm.org/show_bug.cgi?id=40958">40958</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[GISEL] Error legalising neon type at -O0 on AArch64.
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>GlobalISel
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>david.green@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, Matthew.Arsenault@amd.com, quentin.colombet@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This code:
typedef __attribute__((neon_vector_type(4))) float float32x4_t;
typedef struct {
  float32x4_t b;
  float32x4_t c;
} d;
void e() {
  d f = {0,0};
  g(f);
}

Fails during legalisation under:
clang -O0 -target aarch64-linux-gnu -mcpu=cortex-a57 -c 20150303004327-180.c
-mllvm -verify-machineinstrs

With incorrect element types on:
%12:_(<4 x s32>) = G_BUILD_VECTOR %28:_(s64), %30:_(s64)

Without the verify-machineinstrs, it runs into an illegal register copy during
reg alloc.

Bisecting this led back to rL353121, but it may be a knock on effect. I don't
read global isel debug output very well yet. Perhaps it's the narrowing of the
extract that's wrong, not the combining?


The same thing in IR:

; Function Attrs: noinline nounwind optnone
define dso_local void @e() #0 {
entry:
  %f = alloca %struct.d, align 16
  %0 = bitcast %struct.d* %f to i8*
  call void @llvm.memset.p0i8.i64(i8* align 16 %0, i8 0, i64 32, i1 false)
  %1 = bitcast %struct.d* %f to [2 x <4 x float>]*
  %2 = load [2 x <4 x float>], [2 x <4 x float>]* %1, align 16
  %call = call i32 bitcast (i32 (...)* @g to i32 ([2 x <4 x float>])*)([2 x <4
x float>] %2)
  ret void
}</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>