<div dir="ltr">Hi Jiangning,<br><br>I don't understand your logic here - the upper lanes can be undef, right. But undef is a contract that means "anything". So if we zero-extend, we make the upper lanes zero, but zero is a valid implementation of undef.<div><br></div><div>Cheers,</div><div><br></div><div>James</div></div><br><div class="gmail_quote">On Tue, 31 Mar 2015 at 10:53 Jiangning Liu <<a href="mailto:liujiangning1@gmail.com">liujiangning1@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">BTW, this patch is to fix <a href="https://llvm.org/bugs/show_bug.cgi?id=23065" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=23065</a> .<div><br></div><div>Thanks,</div><div>-Jiangning</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-31 17:47 GMT+08:00 Jiangning Liu <span dir="ltr"><<a href="mailto:liujiangning1@gmail.com" target="_blank">liujiangning1@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>The small patch attached is to fix a bug in bitcast optimization of DAGCombiner.</div><div><br></div><div>Originally, the code tries to optimize bitcast with build_vector input to be a scalar_to_vector, if only the bitcast and build_vector can meet some conditions. In particular, it thought "ThisVal.zext(SrcBitSize) == OpVal" is one of the requirements. This requirement means, if zero extension of a narrow element value is equal to the original wide element value, the optimization would be allowed. Unfortunately this is incorrect, because the semantic of scalar_to_vector is the top 1 to N-1 elements are undef rather than zero. So no matter we use zero_extension or sign_extension, this transformation would be always invalid. The patch attached disables this optimization.</div><div><br></div><div>Thanks,</div><div>-Jiangning</div></div>
</blockquote></div><br></div>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</blockquote></div>