llvm-6502/test/Transforms/LoopVectorize
Chandler Carruth a8fb39af83 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229835 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 10:36:19 +00:00
..
AArch64 Move the target specific test case arbitrary-induction-step.ll to test/Transforms/LoopVectorize/AArch64 folder. 2015-01-30 07:33:31 +00:00
ARM
PowerPC Check interleaving without relying on debug output. 2015-02-13 02:13:57 +00:00
X86 [x86,sdag] Two interrelated changes to the x86 and sdag code. 2015-02-19 10:36:19 +00:00
XCore
12-12-11-if-conv.ll
2012-10-20-infloop.ll
2012-10-22-isconsec.ll
align.ll
bsd_regex.ll
bzip_reverse_loops.ll
calloc.ll
cast-induction.ll
conditional-assignment.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
control-flow.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
cpp-new-array.ll
dbg.value.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
debugloc.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
duplicated-metadata.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
ee-crash.ll
exact.ll
flags.ll
float-reduction.ll
funcall.ll
gcc-examples.ll [LoopVectorize] Induction variables: support arbitrary constant step. 2015-01-30 05:02:21 +00:00
global_alias.ll
hoist-loads.ll
i8-induction.ll
if-conv-crash.ll
if-conversion-edgemasks.ll Reformat test case to be easier to migrate to typeless pointers. 2015-02-15 04:13:53 +00:00
if-conversion-nest.ll
if-conversion-reduction.ll
if-conversion.ll Update test case. 2015-02-12 20:40:19 +00:00
if-pred-stores.ll
incorrect-dom-info.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
increment.ll
induction_plus.ll
induction.ll
infiniteloop.ll
intrinsic.ll
lcssa-crash.ll
lifetime.ll
loop-form.ll
loop-vect-memdep.ll Fix broken test from r225159. 2015-01-05 12:34:01 +00:00
memdep.ll
metadata-unroll.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
metadata-width.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
metadata.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
minmax_reduction.ll
multi-use-reduction-bug.ll
multiple-address-spaces.ll
no_array_bounds.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
no_idiv_reduction.ll
no_int_induction.ll
no_outside_user.ll
no_switch.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
nofloat.ll
non-const-n.ll
nsw-crash.ll
opt.ll
phi-hang.ll
ptr_loops.ll
read-only.ll
reduction.ll
reverse_induction.ll [LoopVectorize] Induction variables: support arbitrary constant step. 2015-01-30 05:02:21 +00:00
reverse_iter.ll
runtime-check-address-space.ll
runtime-check-readonly-address-space.ll
runtime-check-readonly.ll
runtime-check.ll
runtime-limit.ll
safegep.ll
same-base-access.ll
scalar-select.ll
scev-exitlim-crash.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
simple-unroll.ll
small-loop.ll
start-non-zero.ll
store-shuffle-bug.ll
struct_access.ll
tbaa-nodep.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
undef-inst-bug.ll
unroll_novec.ll
unsized-pointee-crash.ll
value-ptr-bug.ll
vect.omp.persistence.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
vect.stats.ll
vectorize-once.ll IR: Add 'distinct' MDNodes to bitcode and assembly 2015-01-08 22:38:29 +00:00
version-mem-access.ll [LoopAccesses] Modify test to also check symbolic strides with memchecks 2015-02-18 03:43:32 +00:00
write-only.ll