[x86] Add a really preposterous number of patterns for matching all of
authorChandler Carruth <chandlerc@gmail.com>
Fri, 3 Oct 2014 22:43:17 +0000 (22:43 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 3 Oct 2014 22:43:17 +0000 (22:43 +0000)
commitf159de96bd89d69dd9b9bb61639dbd9c1ee24415
treeaaa0baa93dd80870468c65fe33185d2ef807abf0
parentbe77ea38e6cb218e80954676b9a4bc561b8a02df
[x86] Add a really preposterous number of patterns for matching all of
the various ways in which blends can be used to do vector element
insertion for lowering with the scalar math instruction forms that
effectively re-blend with the high elements after performing the
operation.

This then allows me to bail on the element insertion lowering path when
we have SSE4.1 and are going to be doing a normal blend, which in turn
restores the last of the blends lost from the new vector shuffle
lowering when I got it to prioritize insertion in other cases (for
example when we don't *have* a blend instruction).

Without the patterns, using blends here would have regressed
sse-scalar-fp-arith.ll *completely* with the new vector shuffle
lowering. For completeness, I've added RUN-lines with the new lowering
here. This is somewhat superfluous as I'm about to flip the default, but
hey, it shows that this actually significantly changed behavior.

The patterns I've added are just ridiculously repetative. Suggestions on
making them better very much welcome. In particular, handling the
commuted form of the v2f64 patterns is somewhat obnoxious.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219033 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrSSE.td
test/CodeGen/X86/sse-scalar-fp-arith.ll
test/CodeGen/X86/vector-shuffle-128-v2.ll
test/CodeGen/X86/vector-shuffle-256-v4.ll
test/CodeGen/X86/vector-shuffle-512-v8.ll