Commit Graph

25 Commits

Author SHA1 Message Date
Chris Lattner
c99b5a25bb 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 02:33:14 +00:00
Chris Lattner
0cebe6181a enhance RecordNode and RecordChild comments to indicate what
slot they're recording into, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 02:24:17 +00:00
Chris Lattner
e9eeda878b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97432 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 02:15:34 +00:00
Chris Lattner
ccd23cc2a4 simplify some code now that chain/flag results are not stored in
the vtlist for emitnode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 23:00:47 +00:00
Chris Lattner
ff7fb60f2a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97419 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 21:53:42 +00:00
Chris Lattner
9a21500edc use MorphNodeTo instead of SelectNodeTo. SelectNodeTo
is just a silly wrapper around MorphNodeTo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 20:55:18 +00:00
Chris Lattner
c78f2a3994 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97415 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 20:49:53 +00:00
Chris Lattner
6281cda673 enhance EmitNodeMatcher to keep track of the recorded slot numbers
it will populate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 02:41:25 +00:00
Chris Lattner
e86097af55 add infrastructure to support forming selectnodeto. Not used yet
because I have to go on another detour first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97362 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 02:31:26 +00:00
Chris Lattner
a230f9623d change CheckOpcodeMatcher to hold the SDNodeInfo instead of
the opcode name.  This gives the optimizer more semantic info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97346 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 21:48:43 +00:00
Chris Lattner
db8b6222d4 fix logic in DEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 08:13:23 +00:00
Chris Lattner
247896272a 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97314 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 08:11:15 +00:00
Chris Lattner
82781b938a 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97312 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 07:49:13 +00:00
Chris Lattner
d323fd45e3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97305 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 06:22:57 +00:00
Chris Lattner
d6f0602564 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97218 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 08:08:41 +00:00
Chris Lattner
d4397b9481 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! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 07:36:37 +00:00
Chris Lattner
d6c84720df 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 19:00:39 +00:00
Chris Lattner
04db82d2ba 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 07:45:24 +00:00
Chris Lattner
b21ba71045 rename fooMatcherNode to fooMatcher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97096 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 02:04:40 +00:00
Chris Lattner
06158406c5 add some noop code to push it out of my tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 01:57:41 +00:00
Chris Lattner
60df53e30a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 01:56:48 +00:00
Chris Lattner
23cfda719e contract movechild+checktype into a new checkchild node, shrinking the
x86 table by 1200 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97053 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 20:15:25 +00:00
Chris Lattner
22c48b384c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97051 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 19:52:48 +00:00
Chris Lattner
19b5a7590b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 07:31:45 +00:00
Chris Lattner
91c6a822ba 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 :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 07:06:50 +00:00