[PATCH] D49636: [X86] Add matching for another pattern of PMADDWD.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 21 11:58:08 PDT 2018


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel, zvi.

This is the pattern you get from the loop vectorizer for something like this

int16_t A[1024];
int16_t B[1024];
int32_t C[512];

void pmaddwd() {

  for (int i = 0; i != 512; ++i)
    C[i] = (A[2*i]*B[2*i]) + (A[2*i+1]*B[2*i+1]);

}

In this case we will have (add (mul (build_vector), (build_vector)), (mul (build_vector), (build_vector))). This is different than the pattern we currently match which has the build_vectors between an add and a single multiply. I'm not sure what C code would get you that pattern.


Repository:
  rL LLVM

https://reviews.llvm.org/D49636

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/madd.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49636.156685.patch
Type: text/x-patch
Size: 24054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180721/53eb5109/attachment.bin>


More information about the llvm-commits mailing list