mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
a8fb39af83
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 |
||
---|---|---|
.. | ||
AArch64 | ||
ARM | ||
PowerPC | ||
X86 | ||
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 | ||
control-flow.ll | ||
cpp-new-array.ll | ||
dbg.value.ll | ||
debugloc.ll | ||
duplicated-metadata.ll | ||
ee-crash.ll | ||
exact.ll | ||
flags.ll | ||
float-reduction.ll | ||
funcall.ll | ||
gcc-examples.ll | ||
global_alias.ll | ||
hoist-loads.ll | ||
i8-induction.ll | ||
if-conv-crash.ll | ||
if-conversion-edgemasks.ll | ||
if-conversion-nest.ll | ||
if-conversion-reduction.ll | ||
if-conversion.ll | ||
if-pred-stores.ll | ||
incorrect-dom-info.ll | ||
increment.ll | ||
induction_plus.ll | ||
induction.ll | ||
infiniteloop.ll | ||
intrinsic.ll | ||
lcssa-crash.ll | ||
lifetime.ll | ||
loop-form.ll | ||
loop-vect-memdep.ll | ||
memdep.ll | ||
metadata-unroll.ll | ||
metadata-width.ll | ||
metadata.ll | ||
minmax_reduction.ll | ||
multi-use-reduction-bug.ll | ||
multiple-address-spaces.ll | ||
no_array_bounds.ll | ||
no_idiv_reduction.ll | ||
no_int_induction.ll | ||
no_outside_user.ll | ||
no_switch.ll | ||
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 | ||
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 | ||
simple-unroll.ll | ||
small-loop.ll | ||
start-non-zero.ll | ||
store-shuffle-bug.ll | ||
struct_access.ll | ||
tbaa-nodep.ll | ||
undef-inst-bug.ll | ||
unroll_novec.ll | ||
unsized-pointee-crash.ll | ||
value-ptr-bug.ll | ||
vect.omp.persistence.ll | ||
vect.stats.ll | ||
vectorize-once.ll | ||
version-mem-access.ll | ||
write-only.ll |