llvm-project/llvm/test
Chandler Carruth b89464a9b6 [x86,sdag] Two interrelated changes to the x86 and sdag code.
First, don't combine bit masking into vector shuffles (even ones the
target can handle) once operation legalization has taken place. Custom
legalization of vector shuffles may exist for these patterns (making the
predicate return true) but that custom legalization may in some cases
produce the exact bit math this matches. We only really want to handle
this prior to operation legalization.

However, the x86 backend, in a fit of awesome, relied on this. What it
would do is mark VSELECTs as expand, which would turn them into
arithmetic, which this would then match back into vector shuffles, which
we would then lower properly. Amazing.

Instead, the second change is to teach the x86 backend to directly form
vector shuffles from VSELECT nodes with constant conditions, and to mark
all of the vector types we support lowering blends as shuffles as custom
VSELECT lowering. We still mark the forms which actually support
variable blends as *legal* so that the custom lowering is bypassed, and
the legal lowering can even be used by the vector shuffle legalization
(yes, i know, this is confusing. but that's how the patterns are
written).

This makes the VSELECT lowering much more sensible, and in fact should
fix a bunch of bugs with it. However, as you'll see in the test cases,
right now what it does is point out the *hilarious* deficiency of the
new vector shuffle lowering when it comes to blends. Fortunately, my
very next patch fixes that. I can't submit it yet, because that patch,
somewhat obviously, forms the exact and/or pattern that the DAG combine
is matching here! Without this patch, teaching the vector shuffle
lowering to produce the right code infloops in the DAG combiner. With
this patch alone, we produce terrible code but at least lower through
the right paths. With both patches, all the regressions here should be
fixed, and a bunch of the improvements (like using 2 shufps with no
memory loads instead of 2 andps with memory loads and an orps) will
stay. Win!

There is one other change worth noting here. We had hilariously wrong
vectorization cost estimates for vselect because we fell through to the
code path that assumed all "expand" vector operations are scalarized.
However, the "expand" lowering of VSELECT is vector bit math, most
definitely not scalarized. So now we go back to the correct if horribly
naive cost of "1" for "not scalarized". If anyone wants to add actual
modeling of shuffle costs, that would be cool, but this seems an
improvement on its own. Note the removal of 16 and 32 "costs" for doing
a blend. Even in SSE2 we can blend in fewer than 16 instructions. ;] Of
course, we don't right now because of OMG bad code, but I'm going to fix
that. Next patch. I promise.

llvm-svn: 229835
2015-02-19 10:36:19 +00:00
..
Analysis [x86,sdag] Two interrelated changes to the x86 and sdag code. 2015-02-19 10:36:19 +00:00
Assembler IR: Drop scope from MDTemplateParameter 2015-02-19 00:37:21 +00:00
Bindings [OCaml] Add Llvm.build_empty_phi. 2015-02-06 13:42:03 +00:00
Bitcode [Bitcode reader] Fix a few assertions when reading invalid files 2015-02-16 00:03:11 +00:00
BugPoint IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
CodeGen [x86,sdag] Two interrelated changes to the x86 and sdag code. 2015-02-19 10:36:19 +00:00
DebugInfo Modify llvm-readobj to dump symbol record bytes. 2015-02-18 19:32:05 +00:00
ExecutionEngine Make frem.ll flush after calling printf. 2015-02-18 19:32:28 +00:00
Feature Don't promote asynch EH invokes of nounwind functions to calls 2015-02-11 01:23:16 +00:00
FileCheck
Instrumentation tsan: do not instrument not captured values 2015-02-12 09:55:28 +00:00
Integer
JitListener IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
LTO Introduce Target::createNullTargetStreamer and use it from IRObjectFile. 2015-02-19 00:45:02 +00:00
Linker Add run line that was missing in r228999. 2015-02-13 16:00:03 +00:00
MC [mips][microMIPS] Implement JALX instruction 2015-02-18 17:15:48 +00:00
Object [Object] Support reading 64-bit MIPS ELF archives 2015-02-17 18:54:22 +00:00
Other Don't promote asynch EH invokes of nounwind functions to calls 2015-02-11 01:23:16 +00:00
SymbolRewriter SymbolRewriter: allow rewriting with comdats 2015-01-27 22:57:39 +00:00
TableGen
Transforms [x86,sdag] Two interrelated changes to the x86 and sdag code. 2015-02-19 10:36:19 +00:00
Unit
Verifier Testing commit access 2015-02-18 09:11:50 +00:00
YAMLParser
tools [Objdump] Fixing crash when printing symbols in ELF sections with special types. 2015-02-18 23:00:22 +00:00
.clang-format
CMakeLists.txt Back out two accidental changes that snuck in with r229245. Sorry these 2015-02-14 09:05:58 +00:00
Makefile [gold] Consolidate the gold plugin options and actually search for 2015-02-14 09:43:57 +00:00
Makefile.tests
TestRunner.sh
lit.cfg [gold] Consolidate the gold plugin options and actually search for 2015-02-14 09:43:57 +00:00
lit.site.cfg.in [gold] Consolidate the gold plugin options and actually search for 2015-02-14 09:43:57 +00:00