[PATCH] D42487: [X86][SSE] LowerBUILD_VECTORAsVariablePermute - add support for scaling index vectors

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 14:18:43 PST 2018


craig.topper added inline comments.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:7986
+
+    for (uint64_t i = 0; i != Scale; ++i) {
+      IndexScale += 1ull << (i * ShuffleBits);
----------------
This could maybe use a comment.

These adds are conceptually ORs right? There shouldn't be any carries to the next element.

Can you use Scale in place of 1ull in the loop instead of multiplying afterwards?


================
Comment at: test/CodeGen/X86/var-permute-128.ll:47
+; SSSE3-NEXT:    punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
+; SSSE3-NEXT:    paddd {{.*}}(%rip), %xmm1
+; SSSE3-NEXT:    pshufb %xmm1, %xmm0
----------------
Super annoying that padd doesn't print its constant pool. We should finish D37184.


================
Comment at: test/CodeGen/X86/var-permute-256.ll:1290
+; AVX512F-NEXT:    vpaddq %ymm2, %ymm1, %ymm1
+; AVX512F-NEXT:    vpermd %ymm0, %ymm1, %ymm0
 ; AVX512F-NEXT:    retq
----------------
Add a DQI command line since I think this math would be able to use VMULLQ?


Repository:
  rL LLVM

https://reviews.llvm.org/D42487





More information about the llvm-commits mailing list