1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

44 Commits

Author SHA1 Message Date
Craig Topper
792771e814 Add CheckChildInteger to ISelMatcher operations. Removes nearly 2000 bytes from X86 matcher table.
llvm-svn: 200821
2014-02-05 05:44:28 +00:00
Craig Topper
c81d3bdb0d Use ArrayRef to simplify some code.
llvm-svn: 199712
2014-01-21 07:20:05 +00:00
Craig Topper
4fe6b1993f Add OPC_CheckChildSame0-3 to the DAG isel matcher. This replaces sequences of MoveChild, CheckSame, MoveParent. Saves 846 bytes from the X86 DAG isel matcher, ~300 from ARM, ~840 from Hexagon.
llvm-svn: 192026
2013-10-05 05:38:16 +00:00
Craig Topper
67bc19ea4d Revert r191940 to see if it fixes the build bots.
llvm-svn: 191941
2013-10-04 05:52:17 +00:00
Craig Topper
fb07bce847 Add OPC_CheckChildSame0-3 to the DAG isel matcher. This replaces sequences of MoveChild, CheckSame, MoveParent. Saves 846 bytes from the X86 DAG isel matcher, ~300 from ARM, ~840 from Hexagon.
llvm-svn: 191940
2013-10-04 05:22:20 +00:00
Jay Foad
c146569beb Remove unused STL header includes.
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Chris Lattner
01e8c46349 Flag -> Glue, the ongoing saga
llvm-svn: 122513
2010-12-23 18:28:41 +00:00
Chris Lattner
15e8133b87 continue renaming flag -> glue.
llvm-svn: 122506
2010-12-23 17:03:20 +00:00
Chris Lattner
cb2f61f245 add plumbing for handling multiple result nodes
in some more places.

llvm-svn: 99366
2010-03-24 00:41:19 +00:00
Chris Lattner
eb97397472 don't form a RecordChild or CheckChildType for child #'s over 7, we don't
have enums for them.

llvm-svn: 98597
2010-03-16 00:35:11 +00:00
Chris Lattner
64622464c1 turn off debug spew
llvm-svn: 97912
2010-03-07 07:21:24 +00:00
Chris Lattner
c056e2020e more factoring.
llvm-svn: 97911
2010-03-07 07:20:49 +00:00
Chris Lattner
1f91ca8a89 teach tblgen to be more aggressive when factoring CheckType nodes.
Now it will factor things like this:

CheckType i32
  ...
CheckOpcode ISD::AND
  CheckType i64
  ...

into:

SwitchType:
  i32: ...
  i64:
    CheckOpcode ISD::AND
    ...

This shrinks hte table by a few bytes, nothing spectacular.

llvm-svn: 97908
2010-03-07 07:01:28 +00:00
Chris Lattner
92a814205f introduce a new SwitchTypeMatcher node (which is analogous to
SwitchOpcodeMatcher) and have DAGISelMatcherOpt form it.  This
speeds up selection, particularly for X86 which has lots of 
variants of instructions with only type differences.

llvm-svn: 97645
2010-03-03 06:28:15 +00:00
Chris Lattner
14ef40723a resolve a fixme by having the .td file parser reject thigns like
(set GPR, somecomplexpattern)

if somecomplexpattern doesn't declare what it can match.

llvm-svn: 97513
2010-03-01 22:29:19 +00:00
Chris Lattner
5dea29df83 remove dead code, simplify.
llvm-svn: 97510
2010-03-01 22:19:47 +00:00
Chris Lattner
63fd249741 tolerate factoring the *last* node for CellSPU.
llvm-svn: 97508
2010-03-01 22:04:33 +00:00
Chris Lattner
cdfa80eaaf eliminate the CheckMultiOpcodeMatcher code and have each
ComplexPattern at the root be generated multiple times, once
for each opcode they are part of.  This encourages factoring
because the opcode checks get treated just like everything
else in the matcher.

llvm-svn: 97439
2010-03-01 07:17:40 +00:00
Chris Lattner
8529ea0237 add a new OPC_SwitchOpcode which is semantically equivalent
to a scope where every child starts with a CheckOpcode, but
executes more efficiently.  Enhance DAGISelMatcherOpt to 
form it.

This also fixes a bug in CheckOpcode: apparently the SDNodeInfo
objects are not pointer comparable, we have to compare the
enum name.

llvm-svn: 97438
2010-03-01 06:59:22 +00:00
Chris Lattner
a3ca8f3e2d pull MarkFlagResult out from between an EmitNode/CompleteMatch
pair.  This encourages MorphNodeTo formation, this gets us 200
more MorphNodeTo's on X86 and shrinks the table a bit.

llvm-svn: 97434
2010-03-01 02:33:14 +00:00
Chris Lattner
c63cbf5105 enhance RecordNode and RecordChild comments to indicate what
slot they're recording into, no functionality change.

llvm-svn: 97433
2010-03-01 02:24:17 +00:00
Chris Lattner
17b56423d9 Emit redundant opcode checks for andimm and orimm tests at root
so that we get grouping at the top level.

Add an optimization to reorder type check & record nodes
after opcode checks.  We prefer to expose tree shape 
matching which improves grouping and will enhance the next
optimization.

llvm-svn: 97432
2010-03-01 02:15:34 +00:00
Chris Lattner
44432b5fd6 simplify some code now that chain/flag results are not stored in
the vtlist for emitnode.

llvm-svn: 97429
2010-02-28 23:00:47 +00:00
Chris Lattner
6f5b656bbf enhance the EmitNode/MorphNodeTo operands to take a bit that
specifies whether there is an output flag or not.  Use this
instead of redundantly encoding the chain/flag results in the
output vtlist.

llvm-svn: 97419
2010-02-28 21:53:42 +00:00
Chris Lattner
2cda94eb86 use MorphNodeTo instead of SelectNodeTo. SelectNodeTo
is just a silly wrapper around MorphNodeTo.

llvm-svn: 97416
2010-02-28 20:55:18 +00:00
Chris Lattner
9599b6a5e9 enhance the new isel to use SelectNodeTo for most patterns,
even some the old isel didn't.  There are several parts of
this that make me feel dirty, but it's no worse than the
old isel.  I'll clean up the parts I can do without ripping
out the old one next.

llvm-svn: 97415
2010-02-28 20:49:53 +00:00
Chris Lattner
ecc2545545 enhance EmitNodeMatcher to keep track of the recorded slot numbers
it will populate.

llvm-svn: 97363
2010-02-28 02:41:25 +00:00
Chris Lattner
6b967885bc add infrastructure to support forming selectnodeto. Not used yet
because I have to go on another detour first.

llvm-svn: 97362
2010-02-28 02:31:26 +00:00
Chris Lattner
424f0b580d 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
89241c17a9 fix logic in DEBUG.
llvm-svn: 97315
2010-02-27 08:13:23 +00:00
Chris Lattner
af34410efd teach the optimizer that opcode == ISD::STORE is contradictory
with getType() == MVT::i32 etc.  Teach it that two different
integer constants are contradictory.  This cuts 1K off the X86
table, down to 98k

llvm-svn: 97314
2010-02-27 08:11:15 +00:00
Chris Lattner
73225fdc51 Teach the grouper some simple tricks about looking contradictory
predicates.  For example if we have:

Scope:
  CheckType i32
    ABC
  CheckType f32
    DEF
  CheckType i32
    GHI

Then we know that we can transform this into:
Scope:
  CheckType i32
    Scope
      ABC
      GHI
  CheckType f32
    DEF

This reorders the check for the 'GHI' predicate above
the check for the 'DEF' predidate.  However it is safe to do this
in this situation because we know that a node cannot have both an
i32 and f32 type.

We're now doing more factoring that the old isel did.

llvm-svn: 97312
2010-02-27 07:49:13 +00:00
Chris Lattner
5983d52d4e implement a new optimization to sink pattern predicates (like isSSE1)
as deeply into the pattern as we can get away with.  In pratice, this 
means "all the way to to the emitter code, but not across 
ComplexPatterns".  This substantially increases the amount of factoring
we get.

llvm-svn: 97305
2010-02-27 06:22:57 +00:00
Chris Lattner
ae14b0d790 switch from my nice hashtable based merging solution to a
gross little neighbor merging implementation.  This one has
the benefit of not violating the ordering of patterns, so it
generates code that passes tests again.

llvm-svn: 97218
2010-02-26 08:08:41 +00:00
Chris Lattner
938c57ccc6 finish off the factoring optimization along the lines of the
current design.  This generates a matcher that successfully
runs, but it turns out that the factoring we're doing violates
the ordering of patterns, so we end up matching (e.g.) movups
where we want movaps.  This won't due, but I'll address this in
a follow on patch.  It's nice to not be on by default yet! :)

llvm-svn: 97215
2010-02-26 07:36:37 +00:00
Chris Lattner
e4b5559cf8 change the scope node to include a list of children to be checked
instead of to have a chained series of scope nodes.  This makes
the generated table smaller, improves the efficiency of the
interpreter, and make the factoring optimization much more 
reasonable to implement.

llvm-svn: 97160
2010-02-25 19:00:39 +00:00
Chris Lattner
ea2fcbcd28 Implement the first half of redundancy factoring: efficiently
splitting all the patterns under scope nodes into equality sets
based on their first node.  The second step is to rewrite the
graph info a form that exposes the sharing.  Before I do this, 
I want to redesign the Scope node.

llvm-svn: 97130
2010-02-25 07:45:24 +00:00
Chris Lattner
02110cc687 rename fooMatcherNode to fooMatcher.
llvm-svn: 97096
2010-02-25 02:04:40 +00:00
Chris Lattner
07ef4b0d6d add some noop code to push it out of my tree.
llvm-svn: 97094
2010-02-25 01:57:41 +00:00
Chris Lattner
43351d1bfd rename PushMatcherNode -> ScopeMatcherNode to more accurately
reflect what it does.  Switch the sense of the Next and the Check
arms to be more logical.  No functionality change.

llvm-svn: 97093
2010-02-25 01:56:48 +00:00
Chris Lattner
071ecfc919 contract movechild+checktype into a new checkchild node, shrinking the
x86 table by 1200 bytes.

llvm-svn: 97053
2010-02-24 20:15:25 +00:00
Chris Lattner
119a10f065 split the movechild/record/moveparent -> recordchild optzn into a
movechild/record -> recordchild/movechild and 
movechild/moveparent -> noop xforms.  This slightly shrinks the tables
(x86 to 117454) and enables adding future improvements.

llvm-svn: 97051
2010-02-24 19:52:48 +00:00
Chris Lattner
dbdbb30a7c implement a simple proof-of-concept optimization for
the new isel: fold movechild+record+moveparent into a
single recordchild N node.  This shrinks the X86 table
from 125443 to 117502 bytes.

llvm-svn: 97031
2010-02-24 07:31:45 +00:00
Chris Lattner
c308ed9bd8 The new isel passes all tests, time to start making it go fast.
Also add an easy macro at the top of DAGISelEmitter.cpp to enable
it.  Lets see if I can avoid accidentally turning it on :)

llvm-svn: 97029
2010-02-24 07:06:50 +00:00