llvm-6502/test/Transforms
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
..
ADCE
AddDiscriminators IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
AlignmentFromAssumptions [AlignmentFromAssumptions] Don't crash just because the target is 32-bit 2014-09-11 08:40:17 +00:00
ArgumentPromotion FileCheck-ize a test to make it easier to migrate to typeless pointers 2015-02-15 04:14:00 +00:00
AtomicExpand/ARM Use target-dependent emitLeading/TrailingFence instead of the target-independent insertLeading/TrailingFence (in AtomicExpandPass) 2014-09-03 21:01:03 +00:00
BBVectorize This patch teaches IndVarSimplify to add nuw and nsw to certain kinds 2015-01-06 19:02:56 +00:00
BDCE [BDCE] Don't forget uses of root instructions seen before the instruction itself 2015-02-18 03:12:28 +00:00
BranchFolding Delete -std-compile-opts. 2014-10-16 20:00:02 +00:00
CodeExtractor
CodeGenPrepare [GC] CodeGenPrep transform: simplify offsetable relocate 2015-01-14 23:27:07 +00:00
ConstantHoisting
ConstantMerge
ConstProp Fix a bug around truncating vector in const prop. 2014-08-21 02:12:35 +00:00
CorrelatedValuePropagation LazyValueInfo: Actually re-visit partially solved block-values in solveBlockValue() 2014-11-25 17:23:05 +00:00
DeadArgElim DeadArgElim: aggregate Return assessment properly. 2015-02-11 23:13:11 +00:00
DeadStoreElimination IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
EarlyCSE EarlyCSE: Add check lines for test added in r228760 2015-02-10 23:11:02 +00:00
FunctionAttrs Normally an 'optnone' function goes through fast-isel, which does not 2014-11-03 18:19:26 +00:00
GCOVProfiling IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
GlobalDCE Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
GlobalOpt IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
GVN Allow PRE to insert no-cost phi nodes 2015-02-03 20:37:08 +00:00
IndVarSimplify Fix PR22222 2015-01-15 01:46:09 +00:00
Inline Fix a crash in the assumption cache when inlining indirect function calls 2015-02-12 21:04:22 +00:00
InstCombine [InstCombine] Do not insert a GEP instruction before a landingpad instruction. 2015-02-18 03:30:11 +00:00
InstMerge Minor fix after 229495. 2015-02-18 08:09:28 +00:00
InstSimplify IR: Properly return nullptr when getAggregateElement is out-of-bounds 2015-02-16 04:02:09 +00:00
Internalize
IPConstantProp
IRCE Teach IRCE to look at branch weights when recognizing range checks 2015-01-27 21:38:12 +00:00
JumpThreading Update a test to make it easier to migrate to untyped pointers 2015-02-15 04:13:58 +00:00
LCSSA Update a test to use FileCheck so it's easier to migrate to future typeless pointer changes 2015-02-15 04:13:57 +00:00
LICM Teach isDereferenceablePointer() to look through bitcast constant expressions. 2015-02-05 09:15:37 +00:00
LoadCombine Use AA in LoadCombine 2014-11-03 23:19:16 +00:00
LoopDeletion
LoopIdiom IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
LoopReroll [LoopReroll] Relax some assumptions a little. 2015-02-16 17:02:00 +00:00
LoopRotate LoopRotate: Don't walk the uses of a Constant 2015-01-27 06:21:43 +00:00
LoopSimplify Teach SplitBlockPredecessors how to handle landingpad blocks. 2015-01-28 23:06:47 +00:00
LoopStrengthReduce Reverting VLD1/VST1 base-updating/post-incrementing combining 2015-02-04 10:11:59 +00:00
LoopUnroll Partial fix for bug 22589 2015-02-18 19:32:25 +00:00
LoopUnswitch
LoopVectorize [x86,sdag] Two interrelated changes to the x86 and sdag code. 2015-02-19 10:36:19 +00:00
LowerAtomic
LowerExpectIntrinsic [PM] Port LowerExpectIntrinsic to the new pass manager. 2015-01-24 11:13:02 +00:00
LowerInvoke
LowerSwitch LowerSwitch: replace unreachable default with popular case destination 2015-01-23 20:43:51 +00:00
Mem2Reg IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
MemCpyOpt ValueTracking: Make isBytewiseValue simpler and more powerful at the same time. 2015-02-07 19:29:02 +00:00
MergeFunc IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
MetaRenamer
ObjCARC IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
PartiallyInlineLibCalls
PhaseOrdering
PlaceSafepoints PlaceSafepoints: modernize gc.result.* -> gc.result 2015-02-09 23:00:40 +00:00
PruneEH Fix invalid LLVM IR in PruneEH tests 2015-02-11 02:06:47 +00:00
Reassociate Reassociate: cannot negate a INT_MIN value 2015-02-11 19:54:44 +00:00
Reg2Mem
SampleProfile IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
Scalarizer IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
ScalarRepl IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
SCCP SCCP: overdefined calls cannot become constant 2014-11-07 08:54:19 +00:00
SeparateConstOffsetFromGEP/NVPTX [SeparateConstOffsetFromGEP] Fixed a bug related to unsigned modulo 2014-10-25 18:34:03 +00:00
SimplifyCFG [CodeGenPrepare] Removed duplicate logic. SimplifyCFG already knows how to speculate calls to cttz/ctlz. 2015-02-13 14:15:48 +00:00
Sink
SLPVectorizer [slp] Fix a nasty bug in the SLP vectorizer that Joerg pointed out. 2015-02-12 02:30:56 +00:00
SROA [SROA] Apply a somewhat heavy and unpleasant hammer to fix PR22093, an 2015-01-05 04:17:53 +00:00
StraightLineStrengthReduce Add straight-line strength reduction to LLVM 2015-02-03 19:37:06 +00:00
StripSymbols IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
StructurizeCFG StructurizeCFG: Use a reverse post-order traversal 2015-02-04 20:49:44 +00:00
TailCallElim Fix tail recursion elimination 2014-11-19 13:32:51 +00:00
TailDup
Util Correctly combine alias.scope metadata by a union instead of intersecting 2015-02-08 17:07:14 +00:00