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

1532 Commits

Author SHA1 Message Date
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
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
35b88592cd 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
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
84308c9ca0 emit a histogram of the opcodes in comments.
llvm-svn: 97047
2010-02-24 19:17:12 +00:00
Chris Lattner
fb5e88009e lets not break the old isel.
llvm-svn: 97034
2010-02-24 07:41:11 +00:00
Chris Lattner
c4518bb9c4 Since the new instruction selector now works, I don't need to keep
the old one around for comparative purposes: have the
ENABLE_NEW_ISEL #define (which is not enabled on mainline) stop
emitting the old isel at all, yay for build time win.

llvm-svn: 97033
2010-02-24 07:35:09 +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
Chris Lattner
7878da5c39 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
Sean Callanan
a5bd688c68 Changed the table generator so that the X86
disassembler never recognizes InitReg instructions.

llvm-svn: 97017
2010-02-24 02:56:25 +00:00
Mikhail Glushenkov
653efea01f Trailing whitespace.
llvm-svn: 96923
2010-02-23 09:05:01 +00:00
Mikhail Glushenkov
c47f951a86 Implement order-preserving option forwarding.
Needed to correctly handle things like 'llvmc -framework Foo foo.o -framework
Bar bar.o' - before this commit all '-framework' options would've been grouped
together in the beginning.

Due to our dependence on CommandLine this turned out to be a giant hack; we will
migrate away from CommandLine eventually.

llvm-svn: 96922
2010-02-23 09:04:57 +00:00
Mikhail Glushenkov
232ae779ee Correct option forwarding: initial implementation.
Does not work, but the infrastructure changes are in place.

llvm-svn: 96920
2010-02-23 09:04:44 +00:00
Mikhail Glushenkov
d030cced3d New experimental/undocumented feature: 'works_on_empty'.
For now, just enough support to make -filelist work.

llvm-svn: 96918
2010-02-23 09:04:28 +00:00
Mikhail Glushenkov
947daddd81 Add a way to enable '-opt=foo' forwarding.
llvm-svn: 96916
2010-02-23 09:04:13 +00:00
Chris Lattner
5b5d31f533 add some #if 0'd out code for checking that named values in
input/output patterns have the same type.  It turns out that 
this triggers all the time because we don't infer types 
between these boundaries.  Until we do, don't turn this on.

llvm-svn: 96905
2010-02-23 07:50:58 +00:00
Chris Lattner
8b5a000583 Reject patterns that use a name multiple times in the src or result
of a pattern and where the uses have different types.

llvm-svn: 96904
2010-02-23 07:22:28 +00:00
Chris Lattner
da756c0018 reject patterns that have dead named arguments in the input pattern
this is tidier and can find bugs.

llvm-svn: 96900
2010-02-23 06:55:24 +00:00
Chris Lattner
df30185383 reject patterns that mention a name in the destination pattern
but not in the input.  Previously, this would trigger an abort
late in the isel logic.

llvm-svn: 96898
2010-02-23 06:35:45 +00:00
Chris Lattner
1a749c367d merge some code.
llvm-svn: 96896
2010-02-23 06:16:51 +00:00
Chris Lattner
4c22c51356 more tidying up
llvm-svn: 96891
2010-02-23 05:59:10 +00:00
Chris Lattner
55115233db reduce indentation by eliminating 'else after return'
llvm-svn: 96889
2010-02-23 05:51:07 +00:00