<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Paste wrong LLVM IR case, and the correct one should be,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">
<br></div><div class="gmail_default"><div class="gmail_default"><font face="arial, helvetica, sans-serif">define <8 x i16> @combine_2v(<4 x i16> %x, <4 x i16> %y) #0 {</font></div><div class="gmail_default">
<span style="font-family:arial,helvetica,sans-serif"> %vecext = extractelement <4 x i16> %x, i32 0</span><br></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit = insertelement <8 x i16> undef, i16 %vecext, i32 0</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext1 = extractelement <4 x i16> %x, i32 1</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit2 = insertelement <8 x i16> %vecinit, i16 %vecext1, i32 1</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext3 = extractelement <4 x i16> %x, i32 2</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit4 = insertelement <8 x i16> %vecinit2, i16 %vecext3, i32 2</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext5 = extractelement <4 x i16> %x, i32 3</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit6 = insertelement <8 x i16> %vecinit4, i16 %vecext5, i32 3</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext7 = extractelement <4 x i16> %y, i32 0</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit8 = insertelement <8 x i16> %vecinit6, i16 %vecext7, i32 4</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext9 = extractelement <4 x i16> %y, i32 1</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit10 = insertelement <8 x i16> %vecinit8, i16 %vecext9, i32 5</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext11 = extractelement <4 x i16> %y, i32 2</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit12 = insertelement <8 x i16> %vecinit10, i16 %vecext11, i32 6</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext13 = extractelement <4 x i16> %y, i32 3</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit14 = insertelement <8 x i16> %vecinit12, i16 %vecext13, i32 7</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif"> ret <8 x i16> %vecinit14</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">}</font></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/12/24 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"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">The patch itself is OK for me to upstream.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">
<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">However, we need some improvement in method AArch64TargetLowering::isKnownShuffleVector. Looking at the case below,</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default"><div class="gmail_default"><font face="arial, helvetica, sans-serif">define <8 x i8> @combine_2v(<16 x i8> %x) #0 {</font></div>
<div class="im">
<div class="gmail_default"><span style="font-family:arial,helvetica,sans-serif"> %vecext = extractelement <16 x i8> %x, i32 0</span><br></div></div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit = insertelement <8 x i8> undef, i8 %vecext, i32 0</font></div>
</div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext1 = extractelement <16 x i8> %x, i32 1</font></div></div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit2 = insertelement <8 x i8> %vecinit, i8 %vecext1, i32 1</font></div>
</div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext3 = extractelement <16 x i8> %x, i32 2</font></div></div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit4 = insertelement <8 x i8> %vecinit2, i8 %vecext3, i32 2</font></div>
</div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext5 = extractelement <16 x i8> %x, i32 3</font></div></div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit6 = insertelement <8 x i8> %vecinit4, i8 %vecext5, i32 3</font></div>
</div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext7 = extractelement <16 x i8> %x, i32 4</font></div></div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit8 = insertelement <8 x i8> %vecinit6, i8 %vecext7, i32 4</font></div>
</div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext9 = extractelement <16 x i8> %x, i32 5</font></div></div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit10 = insertelement <8 x i8> %vecinit8, i8 %vecext9, i32 5</font></div>
</div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext11 = extractelement <16 x i8> %x, i32 6</font></div></div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit12 = insertelement <8 x i8> %vecinit10, i8 %vecext11, i32 6</font></div>
</div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecext13 = extractelement <16 x i8> %x, i32 7</font></div></div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> %vecinit14 = insertelement <8 x i8> %vecinit12, i8 %vecext13, i32 7</font></div>
</div><div class="im"><div class="gmail_default"><font face="arial, helvetica, sans-serif"> ret <8 x i8> %vecinit14</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">}</font></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">
<br></div></div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">This is a quite common one, and at present this case is not optimal, so we need to give some more follow-ups.</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Thanks,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">
-Jiangning</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/20 Kevin Qin <span dir="ltr"><<a href="mailto:kevinqindev@gmail.com" target="_blank">kevinqindev@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Hi,<br>
<br>
DAG.getVectorShuffle() doesn't always return a vector_shuffle node. If mask is the exact sequence of it's operand(For example, operand_0 is v8i8, and the mask is 0, 1, 2, 3, 4, 5, 6, 7), it will directly return that operand. So a check is added here. Please review.<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D2452" target="_blank">http://llvm-reviews.chandlerc.com/D2452</a><br>
<br>
Files:<br>
lib/Target/AArch64/AArch64ISelLowering.cpp<br>
test/CodeGen/AArch64/neon-copy.ll<br>
<br>
Index: lib/Target/AArch64/AArch64ISelLowering.cpp<br>
===================================================================<br>
--- lib/Target/AArch64/AArch64ISelLowering.cpp<br>
+++ lib/Target/AArch64/AArch64ISelLowering.cpp<br>
@@ -3957,7 +3957,10 @@<br>
if (V1.getNode() && NumElts == V0NumElts &&<br>
V0NumElts == V1.getValueType().getVectorNumElements()) {<br>
SDValue Shuffle = DAG.getVectorShuffle(VT, DL, V0, V1, Mask);<br>
- Res = LowerVECTOR_SHUFFLE(Shuffle, DAG);<br>
+ if(Shuffle.getOpcode() != ISD::VECTOR_SHUFFLE)<br>
+ Res = Shuffle;<br>
+ else<br>
+ Res = LowerVECTOR_SHUFFLE(Shuffle, DAG);<br>
return true;<br>
} else<br>
return false;<br>
Index: test/CodeGen/AArch64/neon-copy.ll<br>
===================================================================<br>
--- test/CodeGen/AArch64/neon-copy.ll<br>
+++ test/CodeGen/AArch64/neon-copy.ll<br>
@@ -703,4 +703,26 @@<br>
%e = insertelement <4 x i32> %d, i32 %b, i32 2<br>
%f = insertelement <4 x i32> %e, i32 %b, i32 3<br>
ret <4 x i32> %f<br>
-}<br>
\ No newline at end of file<br>
+}<br>
+<br>
+define <8 x i8> @getl(<16 x i8> %x) #0 {<br>
+; CHECK-LABEL: getl:<br>
+; CHECK: ret<br>
+ %vecext = extractelement <16 x i8> %x, i32 0<br>
+ %vecinit = insertelement <8 x i8> undef, i8 %vecext, i32 0<br>
+ %vecext1 = extractelement <16 x i8> %x, i32 1<br>
+ %vecinit2 = insertelement <8 x i8> %vecinit, i8 %vecext1, i32 1<br>
+ %vecext3 = extractelement <16 x i8> %x, i32 2<br>
+ %vecinit4 = insertelement <8 x i8> %vecinit2, i8 %vecext3, i32 2<br>
+ %vecext5 = extractelement <16 x i8> %x, i32 3<br>
+ %vecinit6 = insertelement <8 x i8> %vecinit4, i8 %vecext5, i32 3<br>
+ %vecext7 = extractelement <16 x i8> %x, i32 4<br>
+ %vecinit8 = insertelement <8 x i8> %vecinit6, i8 %vecext7, i32 4<br>
+ %vecext9 = extractelement <16 x i8> %x, i32 5<br>
+ %vecinit10 = insertelement <8 x i8> %vecinit8, i8 %vecext9, i32 5<br>
+ %vecext11 = extractelement <16 x i8> %x, i32 6<br>
+ %vecinit12 = insertelement <8 x i8> %vecinit10, i8 %vecext11, i32 6<br>
+ %vecext13 = extractelement <16 x i8> %x, i32 7<br>
+ %vecinit14 = insertelement <8 x i8> %vecinit12, i8 %vecext13, i32 7<br>
+ ret <8 x i8> %vecinit14<br>
+}<br>
<br></div></div>_______________________________________________<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/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><font face="courier new, monospace">Thanks,</font><div><font face="courier new, monospace">-Jiangning</font></div>
</div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><font face="courier new, monospace">Thanks,</font><div><font face="courier new, monospace">-Jiangning</font></div></div>
</div>