<div dir="ltr">Elena,<div><br></div><div>On 256-bit versions of vector-shuffle lowering (lowerV8F32VectorShuffle, lowerV8I32VectorShuffle etc), you can see that there is big difference inside the functions (except broadcasts and blends). I assume Chandler provided opportunity to implement 512-bit vector-shuffle lowering in the same way in future.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-22 12:08 GMT+04:00 Demikhovsky, Elena <span dir="ltr"><<a href="mailto:elena.demikhovsky@intel.com" target="_blank">elena.demikhovsky@intel.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Why do you need so many functions:<br>
lowerV16F32VectorShuffle<br>
lowerV8I64VectorShuffle<br>
lowerV16I32VectorShuffle<br>
.. ?<br>
<br>
I don't see a big diff between them.<br>
<br>
-  Elena<br>
<div><div class="h5"><br>
<br>
-----Original Message-----<br>
From: Robert Khasanov [mailto:<a href="mailto:rob.khasanov@gmail.com">rob.khasanov@gmail.com</a>]<br>
Sent: Tuesday, October 21, 2014 21:03<br>
To: <a href="mailto:rob.khasanov@gmail.com">rob.khasanov@gmail.com</a>; <a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a><br>
Cc: Demikhovsky, Elena; <a href="mailto:anemet@apple.com">anemet@apple.com</a>; <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
Subject: [PATCH] [AVX512] Bring back vector-shuffle lowering support through broadcasts<br>
<br>
Hi chandlerc,<br>
<br>
I found that after your commit at rev219046 512-bit broadcasts lowering become non-optimal. Most of tests on broadcasting and embedded broadcasting were changed and they doesn’t produce efficient code.<br>
<br>
Example below is from your commit changes (it’s the first test from test/CodeGen/X86/avx512-vbroadcast.ll):<br>
<br>
 define   <16 x i32> @_inreg16xi32(i32 %a) {<br>
 ; CHECK-LABEL: _inreg16xi32:<br>
 ; CHECK:       ## BB#0:<br>
-; CHECK-NEXT:    vpbroadcastd %edi, %zmm0<br>
+; CHECK-NEXT:    vmovd %edi, %xmm0<br>
+; CHECK-NEXT:    vpbroadcastd %xmm0, %ymm0<br>
+; CHECK-NEXT:    vinserti64x4 $1, %ymm0, %zmm0, %zmm0<br>
 ; CHECK-NEXT:    retq<br>
 %b = insertelement <16 x i32> undef, i32 %a, i32 0<br>
  %c = shufflevector <16 x i32> %b, <16 x i32> undef, <16 x i32> zeroinitializer<br>
   ret <16 x i32> %c<br>
}<br>
<br>
Here, 256-bit broadcast was generated instead of 512-bit one.<br>
<br>
I investigated the reason, found that in your version of vector-shuffle lowering there is no AVX-512 support.<br>
<br>
In this patch<br>
1) I added vector-shuffle lowering through broadcasts<br>
2) Removed asserts and branches likes because this is incorrect<br>
-  assert(Subtarget->hasDQI() && "We can only lower v8i64 with AVX-512-DQI");<br>
3) Fixed lowering tests<br>
<br>
<a href="http://reviews.llvm.org/D5885" target="_blank">http://reviews.llvm.org/D5885</a><br>
<br>
Files:<br>
  lib/Target/X86/X86ISelLowering.cpp<br>
  lib/Target/X86/X86InstrAVX512.td<br>
  test/CodeGen/X86/avx512-arith.ll<br>
  test/CodeGen/X86/avx512-vbroadcast.ll<br>
  test/CodeGen/X86/avx512-vec-cmp.ll<br>
  test/CodeGen/X86/vector-shuffle-512-v8.ll<br>
</div></div>---------------------------------------------------------------------<br>
Intel Israel (74) Limited<br>
<br>
This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">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>
</blockquote></div><br></div>