[PATCH] D49829: [X86] Add pattern matching for PMADDUBSW

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 03:28:11 PDT 2018


RKSimon requested changes to this revision.
RKSimon added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:36821
+      N11.getValueType().getVectorElementType() != MVT::i8)
+    return SDValue();
+
----------------
Couldn't you merge all these sets of canonicalization early-outs together to safe space?


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:36837
+  // is being performed:
+  //  A[2 * i] * B[2 * i] + A[2 * i + 1] * B[2 * i + 1]
+  SDValue ZExtIn, SExtIn;
----------------
I always get nervous when we add vectorization detection in the DAG.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:36839
+  SDValue ZExtIn, SExtIn;
+  for (unsigned i = 0; i != N00.getNumOperands(); ++i) {
+    SDValue N00Elt = N00.getOperand(i);
----------------
for (unsigned i = 0, e = N00.getNumOperands(); i != e; ++i) {

or use NumElems?


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:36865
+    }
+    // N0 indices be the even elemtn. N1 indices must be the next odd element.
+    if (IdxN00 != 2 * i || IdxN10 != 2 * i + 1 ||
----------------
element


================
Comment at: test/CodeGen/X86/madd.ll:2
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=SSE2
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+ssse3 | FileCheck %s --check-prefix=SSE2
 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX,AVX1
----------------
prefix doesn't match the sse level - please can you put the pmaddusbw tests in pmaddusbw.ll - I don;t think its worth adding SSSE3 tests to madd.ll tbh


https://reviews.llvm.org/D49829





More information about the llvm-commits mailing list