Page MenuHomePhabricator

[X86] Add matching for another pattern of PMADDWD.
ClosedPublic

Authored by craig.topper on Jul 21 2018, 11:58 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jul 21 2018, 11:58 AM
zvi accepted this revision.Jul 26 2018, 12:26 PM

LGTM. Thanks!

This revision is now accepted and ready to land.Jul 26 2018, 12:26 PM
This revision was automatically updated to reflect the committed changes.