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

1555 Commits

Author SHA1 Message Date
Chris Lattner
745181da4b remove a little hack I did for the old isel, not needed
now that it is gone.

llvm-svn: 97516
2010-03-01 22:51:11 +00:00
Chris Lattner
e37f8fa74a resolve some fixmes
llvm-svn: 97515
2010-03-01 22:49:06 +00:00
Chris Lattner
4fb9708649 resolve a fixme and simplify code by moving insertion of the
EmitMergeInputChainsMatcher node up into EmitResultCode.  This
doesn't have much of an effect on the generated code, the X86
table is exactly the same size.

llvm-svn: 97514
2010-03-01 22:46:42 +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
c0839055a9 Fix PR2590 by making PatternSortingPredicate actually be
ordered correctly.  Previously it would get in trouble when
two patterns were too similar and give them nondet ordering.
We force this by using the record ID order as a fallback.

The testsuite diff is due to alpha patterns being ordered
slightly differently, the change is a semantic noop afaict:

< 	lda $0,-100($16)
---
> 	subq $16,100,$0

llvm-svn: 97509
2010-03-01 22:09:11 +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
7cc2cd25c4 optimize tblgen compile time by eliminating the old isel.
llvm-svn: 97504
2010-03-01 21:49:54 +00:00
Chris Lattner
8396bae92e don't emit the old sdnodexform stuff for the new isel.
llvm-svn: 97486
2010-03-01 19:39:15 +00:00
Chris Lattner
5efedae9ae Turn on the new isel by default. Here are some fun numbers
with a release-asserts build on x86-64-darwin10:

LLC Size:
Old: 15,426,852
New: 12,759,140  (down 2.7M)

LLI Size:
Old: 9,926,876
New: 8,864,292   (down 1.1M)

X86ISelDAGToDAG.o size:
Old: 1,401,232
New:   162,868   (down 1.3M)

Time to build X86ISelDAGToDAG.o:
Old: 67.147u 2.060s 1:09.78
New:  4.234u 0.387s 0:04.77

llvm-svn: 97475
2010-03-01 19:05:25 +00:00
Torok Edwin
de233f5c2b Missed a \n in previous commit.
llvm-svn: 97472
2010-03-01 19:00:55 +00:00
Torok Edwin
2f53637d40 Add command-line flag to tblgen to turn off generating comments for the new
isel (defaults it to generate comments).
This reduces the size of the generated source file.

llvm-svn: 97470
2010-03-01 18:49:10 +00:00
Chris Lattner
19b59d2278 Emit type checks late instead of early, this encourages
structural matching code to be factored and shared this
shrinks the X86 isel table from 86537 to 83890 bytes.

llvm-svn: 97442
2010-03-01 07:54:59 +00:00
Chris Lattner
4baff2da00 Emit a redundant check for immediates at root context, e.g. (imm 0).
This allows formation of OpcodeSwitch for top level patterns, in
particular on X86.  This saves about 1K of data space in the x86
table and makes the dispatch much more efficient.

llvm-svn: 97440
2010-03-01 07:27:07 +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
ac55b2ddbc inline the node transforms and node predicates into the generated
dispatcher method.  This eliminates the dependence of the new isel's
generated code on the old isel's predicates, however some random
hand written isel code still uses them.

llvm-svn: 97431
2010-03-01 01:54:19 +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
3501066119 don't emit useless functions. These were producing
warnings in release-assert builds if there were no cases.

llvm-svn: 97428
2010-02-28 22:57:03 +00:00
Chris Lattner
d49712e905 change a few opcodes to use VBRs instead of embedding
immediate sizes into the opcode.

llvm-svn: 97423
2010-02-28 22:14:32 +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
9f3d4dff50 Generalize my hack to use SDNodeInfo to find out when a
node is always guaranteed to have a particular type 
instead of hacking in ISD::STORE explicitly.  This allows
us to use implied types for a broad range of nodes, even
target specific ones.

llvm-svn: 97355
2010-02-28 00:22:30 +00:00
Dan Gohman
99c6bcbc13 The mayHaveSideEffects flag is no longer used.
llvm-svn: 97348
2010-02-27 23:47:46 +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
c204d184a1 add another case from the ppc backend. This is obviously a huge and
dissatisfying hack.  TODO: Improve it. :)

llvm-svn: 97317
2010-02-27 08:19:47 +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
fb0ddbc3b4 use DEBUG instead of DebugFlag directly so that this
respects -debug-only=something-else.

llvm-svn: 97307
2010-02-27 06:51:44 +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
594d027cdb add some helpful comments to the emitter
llvm-svn: 97219
2010-02-26 08:15:02 +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
c84d763dfb fix same bug in CheckChainCompatibleMatcher::isEqualImpl
llvm-svn: 97217
2010-02-26 08:06:02 +00:00
Chris Lattner
a26437c8f2 fix a nasty bug in CheckTypeMatcher::isEqualImpl
llvm-svn: 97216
2010-02-26 08:05:36 +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
6f18300453 add a new setNumChildren method for resizing scopes. Tweak getHash() so
that we never return a tombstone value, which (thankfully) triggers an
assert in densemap.

llvm-svn: 97214
2010-02-26 07:35:27 +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
3c648b2491 factor the print method better.
llvm-svn: 97125
2010-02-25 06:53:39 +00:00
Chris Lattner
c40658bc35 add methods to do equality checks and get hashes of Matchers
llvm-svn: 97123
2010-02-25 06:49:58 +00:00
Chris Lattner
e875ef2dc9 formatting.
llvm-svn: 97097
2010-02-25 02:09:00 +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