Commit Graph

32 Commits

Author SHA1 Message Date
Chris Lattner 278606b06e change CheckOpcodeMatcher to hold the SDNodeInfo instead of
the opcode name.  This gives the optimizer more semantic info.

llvm-svn: 97346
2010-02-27 21:48:43 +00:00
Chris Lattner 2c3f6492b0 rename fooMatcherNode to fooMatcher.
llvm-svn: 97096
2010-02-25 02:04:40 +00:00
Chris Lattner e03e2fa3ed add a fixme for an experiment that defeated me for the time being.
llvm-svn: 97081
2010-02-25 00:03:03 +00:00
Chris Lattner 29364373cc The new isel was not properly handling patterns that covered
internal nodes with flag results.  Record these with a new 
OPC_MarkFlagResults opcode and use this to update the interior
nodes' flag results properly.  This fixes CodeGen/X86/i256-add.ll
with the new isel.

llvm-svn: 97021
2010-02-24 05:33:42 +00:00
Chris Lattner d0b16bd219 Change ComplexPattern handling to push the node being matched as
well as the operands produced when the pattern is matched.  This
allows CheckSame to work correctly when matching replicated 
names involving ComplexPatterns.  This fixes a bunch of MSP430 
failures, we're down to 13 failures, two of which are
due to a sched bug.

llvm-svn: 96824
2010-02-22 23:33:44 +00:00
Chris Lattner bb2afb79c0 add a new CheckMultiOpcode opcode for checking that a node
has one of the list of acceptable opcodes for a complex 
pattern.  This fixes 4 regtest failures.

llvm-svn: 96814
2010-02-22 22:30:37 +00:00
Chris Lattner a5a298517e When matching patterns that have a complex pattern as their root, make
sure to only run the complex pattern on nodes where the target opts in.
This patch only handles targets with one opcode specified so far, but
fixes 16 failures, only 34 left.

llvm-svn: 96813
2010-02-22 22:18:05 +00:00
Chris Lattner 9fd97c3690 fix most of the failures in the x86 suite by handling multiple
result nodes correctly.  Note that this includes a horrible hack
in DAGISelHeader which cannot be fixed reasonably without 
eliminating (parallel) from input patterns.  That, in turn,
can't be done until we support writing multiple result patterns
for the X86and_flag and related multiple-result nodes.

llvm-svn: 96767
2010-02-21 23:54:05 +00:00
Chris Lattner 2bad7b0456 Always emit register class id references as i32 like
DAGISelEmitter does.  This fixes 11 arm failures (8 
left).

llvm-svn: 96757
2010-02-21 20:53:45 +00:00
Chris Lattner 79eaeb4cfe implement the last known missing feature: updating uses of results
of the matched pattern to use the newly created node results.  Onto
the "making it actually work" phase!

llvm-svn: 96724
2010-02-21 06:03:07 +00:00
Chris Lattner 132df652a4 Lots of improvements to the new dagisel emitter. This gets it to
the point where it is to the 95% feature complete mark, it just
needs result updating to be done (then testing, optimization 
etc).

More specificallly, this adds support for chain and flag handling
on the result nodes, support for sdnodexforms, support for variadic
nodes, memrefs, pinned physreg inputs, and probably lots of other
stuff.

In the old DAGISelEmitter, this deletes the dead code related to
OperatorMap, cleans up a variety of dead stuff handling "implicit
remapping" from things like globaladdr -> targetglobaladdr (which
is no longer used because globaladdr always needs to be legalized),
and some minor formatting fixes.

llvm-svn: 96716
2010-02-21 03:22:59 +00:00
Chris Lattner dc61962e67 I confused myself, temporaries will be recorded right along with other inputs.
llvm-svn: 96639
2010-02-19 00:33:13 +00:00
Chris Lattner 16cd8cdec1 introduce a new ResultVal and start keeping track of temporary values.
llvm-svn: 96636
2010-02-19 00:27:40 +00:00
Chris Lattner 42a7ba7a67 add support for referencing registers and immediates,
building the tree to represent them but not emitting 
table entries for them yet.

llvm-svn: 96617
2010-02-18 22:03:03 +00:00
Chris Lattner 7ed81690ab start sketching out the structure of code for result emission generation.
Nothing real here yet.

llvm-svn: 96575
2010-02-18 06:47:49 +00:00
Chris Lattner 186ad8098e rename the child field to 'next'. This is not a parent/child
relationship, this is a linear list relationship.

llvm-svn: 96561
2010-02-18 02:53:41 +00:00
Chris Lattner d582a367b5 eliminate the MatcherNodeWithChild class, give the 'child'
field to MatcherNode.

llvm-svn: 96560
2010-02-18 02:49:24 +00:00
Chris Lattner f8a5bb0f89 Emulate the current isel's "IsChainCompatible" logic for now.
I'd like to eventually rip it out, but for now producing the
same selections as the old matcher is more important.

llvm-svn: 96458
2010-02-17 06:23:39 +00:00
Chris Lattner 8ad29342b8 properly record chain inputs to complex patterns,
resolving a fixme.

llvm-svn: 96457
2010-02-17 06:08:25 +00:00
Chris Lattner 469cfb9fdf Prep work to handle input chains of matched patterns and checking for
'ischaincompatible' when a pattern has more than one input chain.  Need
to do some commenting and cleanup now that I understand how this works.

llvm-svn: 96443
2010-02-17 02:16:19 +00:00
Chris Lattner 022e511f4a record input chains.
llvm-svn: 96437
2010-02-17 01:34:15 +00:00
Chris Lattner ac27c2e3f3 prefix captured value names with $ so they look like
variables.  Use the fancy OpNo variable instead of i,
which has the right index including chains.

llvm-svn: 96436
2010-02-17 01:27:29 +00:00
Chris Lattner f773f03736 improve comments on OPC_Record to say what we're recording a node.
llvm-svn: 96433
2010-02-17 01:03:09 +00:00
Chris Lattner a845f654fa make the new isel generator plop out a CheckComplexPattern function
for evaluating complex patterns.  Some cleanup has to happen before
this can be used though.

llvm-svn: 96419
2010-02-17 00:31:50 +00:00
Chris Lattner 7b390142fc fix inverted condition.
llvm-svn: 96416
2010-02-17 00:11:30 +00:00
Chris Lattner e2347aac52 complex patterns don't get 'record' nodes, they implicitly
record all their results.

llvm-svn: 96412
2010-02-16 23:16:25 +00:00
Chris Lattner afac7dad21 fix rdar://7653908, a crash on a case where we would fold a load
into a roundss intrinsic, producing a cyclic dag.  The root cause
of this is badness handling ComplexPattern nodes in the old dagisel
that I noticed through inspection.  Eliminate a copy of the of the
code that handled ComplexPatterns by making EmitChildMatchCode call
into EmitMatchCode.

llvm-svn: 96408
2010-02-16 22:35:06 +00:00
Chris Lattner 6c132331ee simplify this code. In the new world order there is no
need to scan the entire subtree of the pattern anymore.

llvm-svn: 96369
2010-02-16 19:19:58 +00:00
Chris Lattner f8695c1ee9 convert the new matcher to check intermediate nodes for a single
use and only call IsProfitableToFold/IsLegalToFold on the load
being folded, like the old dagiselemitter does.  This 
substantially simplifies the code and improves opportunities for
sharing.

llvm-svn: 96368
2010-02-16 19:15:55 +00:00
Chris Lattner 812586ad2a remove now dead code and fixme.
llvm-svn: 96333
2010-02-16 06:15:00 +00:00
Chris Lattner aa7d3e096b add support for the new isel matcher to generate
(isprofitable|islegal)tofold checks.

llvm-svn: 96331
2010-02-16 06:10:58 +00:00
Chris Lattner b02cdaaa9c Check in the first big step of rewriting DAGISelEmitter to
produce a table based matcher instead of gobs of C++ Code.

Though it's not done yet, the shrinkage seems promising,
the table for the X86 ISel is 75K and still has a lot of 
optimization to come (compare to the ~1.5M of .o generated
the old way, much of which will go away).

The code is currently disabled by default (the #if 0 in
DAGISelEmitter.cpp).  When enabled it generates a dead
SelectCode2 function in the DAGISel Header which will
eventually replace SelectCode.

There is still a lot of stuff left to do, which are
documented with a trail of FIXMEs.

llvm-svn: 96215
2010-02-15 08:04:42 +00:00