<div dir="ltr">The backend bug may be masked after <br><h2 id="m_-2044137723601650326gmail-:lv" class="m_-2044137723601650326gmail-hP"><br>
<a href="https://reviews.llvm.org/rL343406" rel="noreferrer" target="_blank">https://reviews.llvm.org/rL343406</a></h2></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Sep 29, 2018 at 8:24 AM Sanjay Patel <<a href="mailto:spatel@rotateright.com" target="_blank">spatel@rotateright.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sat, Sep 29, 2018 at 7:52 AM Jan Vesely <<a href="mailto:jan.vesely@rutgers.edu" target="_blank">jan.vesely@rutgers.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
it creates <3 x i8>, which is then shuffled into another <3 x i8>, which is then bitcast to <4 x i8>:<br>
<br>
  %vecinit.i = insertelement <3 x i8> undef, i8 %2, i32 0<br>
  %vecinit1.i = insertelement <3 x i8> %vecinit.i, i8 %3, i32 1<br>
  %vecinit4.i = insertelement <3 x i8> %vecinit1.i, i8 %4, i32 2<br>
<br>
  %extractVec = shufflevector <3 x i8> %vecinit4.i, <3 x i8> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 undef><br>
  ^^^ the shuffle result should probably be <4 x i8> ????<br></blockquote><div><br></div><div>Thanks for reporting the bug. The result of that shuffle is <4 x i8>; the mask has 4 elements:</div><div><a href="http://llvm.org/docs/LangRef.html#shufflevector-instruction" target="_blank">http://llvm.org/docs/LangRef.html#shufflevector-instruction</a><br></div><div><br></div><div>So I think we've exposed a backend bug. Can you file a bug report and attach the test files there? Given that this patch fixes a miscompile in IR, I'd rather not revert it unless we can't correct the backend in some reasonable amount of time.<br></div><div><br></div><div>The test case also suggests that we can limit the fix that this patch imposed: if we're shuffling only to extend a series of insertelement ops, then that's a good candidate for widening because we are not introducing any wider math ops. That's a workaround for the backend bug in this particular case, but it doesn't solve the root cause of the crashing.<br></div><div><br></div><div> </div></div></div></div>
</blockquote></div>