<div dir="ltr"><div><div>The error is due to a missing def-pat for (i64 0)</div><div><br></div><div>ISEL: Starting pattern match</div><div>  Initial Opcode index to 85068</div><div>  Match failed at index 85076</div><div>LLVM ERROR: Cannot select: t47: v8i16 = insert_subvector undef:v8i16, t43, Constant:i64<0></div></div><div><br></div><div>The code generated from llvm/lib/Target/AArch64/AArch64InstrInfo.td</div><div><br></div><div>def : Pat<(insert_subvector undef, (v4i16 FPR64:$src), (i32 0)),</div><div>          (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)), FPR64:$src, dsub)>;</div><div><br></div><div>is in ninja/lib/Target/AArch64/AArch64GenDAGISel.inc</div><div>At the location of the error it is:</div><div><div>/* 85076*/    OPC_CheckChild2Type, MVT::i32,</div></div><div><br></div><div>And it failed to match the type of operand 2.</div><div><br></div><div>adding another def-pat like this fixes it:</div><div><br></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">def : Pat<(insert_subvector undef, (v4i16 FPR64:$src), (i64 0)),</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">          (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)), FPR64:$src, dsub)>;</div><br></div><div>I will submit a patch.</div><div><br></div><div>Sebastian</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 7, 2018 at 2:50 PM, Sebastian Pop <span dir="ltr"><<a href="mailto:sebpop@gmail.com" target="_blank">sebpop@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I'm looking at the reduced test.<div>Thanks for the heads'up.</div></div><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 7, 2018 at 11:11 AM, David Green <span dir="ltr"><<a href="mailto:David.Green@arm.com" target="_blank">David.Green@arm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello<br>
<br>
I believe this is the commit causing this code to fail to compile. It's reduced from some randomised neon code, so sorry if it's a bit ugly. Running with llc claims:<br>
<br>
error in backend: Cannot select: t47: v8i16 = insert_subvector undef:v8i16, t43,<br>
      Constant:i64<0><br>
<br>
<br>
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:6<wbr>4-i128:128-n32:64-S128"<br>
target triple = "aarch64--linux-gnu"<br>
<br>
@d = common dso_local local_unnamed_addr global <4 x i16> zeroinitializer, align 8<br>
<br>
define <8 x i16> @c(i32 %e) {<br>
entry:<br>
  %0 = load <4 x i16>, <4 x i16>* @d, align 8<br>
  %vminv = tail call i32 @llvm.aarch64.neon.uminv.i32.v<wbr>4i16(<4 x i16> %0)<br>
  %1 = trunc i32 %vminv to i16<br>
  %vecinit3 = insertelement <4 x i16> <i16 undef, i16 undef, i16 0, i16 0>, i16 %1, i32 1<br>
  %call = tail call <8 x i16> @c(i32 0) #3<br>
  %vgetq_lane = extractelement <8 x i16> %call, i32 0<br>
  %vset_lane = insertelement <4 x i16> %vecinit3, i16 %vgetq_lane, i32 0<br>
  %call4 = tail call i32 bitcast (i32 (...)* @k to i32 (<4 x i16>)*)(<4 x i16> %vset_lane) #3<br>
  ret <8 x i16> undef<br>
}<br>
<br>
declare i32 @llvm.aarch64.neon.uminv.i32.v<wbr>4i16(<4 x i16>)<br>
declare i32 @k(...)<br>
<br>
<br>
Any ideas? I'm surprised this isExtractSubvectorCheap would be causing this.<br>
Cheers<br>
Dave<br>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>