Commit Graph

1527 Commits

Author SHA1 Message Date
Chris Lattner 99e53b3b33 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 8c5d683aa9 The mayHaveSideEffects flag is no longer used.
llvm-svn: 97348
2010-02-27 23:47:46 +00:00
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 fb2a0f20dd 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 21a7bf3fab fix logic in DEBUG.
llvm-svn: 97315
2010-02-27 08:13:23 +00:00
Chris Lattner 2586c86a8a 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 c577b816fc 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 7f28b8e8eb 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 d9e1e83e3b 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 4835aecd95 add some helpful comments to the emitter
llvm-svn: 97219
2010-02-26 08:15:02 +00:00
Chris Lattner 4f9a671a30 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 1ffcde2f3b fix same bug in CheckChainCompatibleMatcher::isEqualImpl
llvm-svn: 97217
2010-02-26 08:06:02 +00:00
Chris Lattner a6142a241a fix a nasty bug in CheckTypeMatcher::isEqualImpl
llvm-svn: 97216
2010-02-26 08:05:36 +00:00
Chris Lattner be5b634cea 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 81129177a3 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 f7fc2d8b86 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 62702da070 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 1f2adb6f35 factor the print method better.
llvm-svn: 97125
2010-02-25 06:53:39 +00:00
Chris Lattner 212e8c87ae add methods to do equality checks and get hashes of Matchers
llvm-svn: 97123
2010-02-25 06:49:58 +00:00
Chris Lattner fef371d2f6 formatting.
llvm-svn: 97097
2010-02-25 02:09:00 +00:00
Chris Lattner 2c3f6492b0 rename fooMatcherNode to fooMatcher.
llvm-svn: 97096
2010-02-25 02:04:40 +00:00
Chris Lattner c36ab923c6 add some noop code to push it out of my tree.
llvm-svn: 97094
2010-02-25 01:57:41 +00:00
Chris Lattner ac55f9df88 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 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 0c95baa848 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 6b79232138 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 9203ca8995 emit a histogram of the opcodes in comments.
llvm-svn: 97047
2010-02-24 19:17:12 +00:00
Chris Lattner 739517da07 lets not break the old isel.
llvm-svn: 97034
2010-02-24 07:41:11 +00:00
Chris Lattner 9812470bc4 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 ab41756c2e 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 e7327435a7 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 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
Sean Callanan 69c0226ba8 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 f4c5cfac0d Trailing whitespace.
llvm-svn: 96923
2010-02-23 09:05:01 +00:00
Mikhail Glushenkov 3222d94a28 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 a44e838bcb 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 ebf8fbbb8f 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 e499d576a9 Add a way to enable '-opt=foo' forwarding.
llvm-svn: 96916
2010-02-23 09:04:13 +00:00
Chris Lattner 4b9225b41a 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 5b0e24902b 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 a7722b6f76 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 94d3b0a77d 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 0c0baa91a4 merge some code.
llvm-svn: 96896
2010-02-23 06:16:51 +00:00
Chris Lattner f66b6aa232 more tidying up
llvm-svn: 96891
2010-02-23 05:59:10 +00:00
Chris Lattner ee820ace06 reduce indentation by eliminating 'else after return'
llvm-svn: 96889
2010-02-23 05:51:07 +00:00
Chris Lattner addbb0290c really fix an off-by-one error
llvm-svn: 96845
2010-02-23 01:07:39 +00:00
Chris Lattner a7d0e304e9 switch the value# in OPC_CompleteMatch and OPC_EmitNode to use a
VBR encoding for the insanity being perpetrated by the spu backend. 

llvm-svn: 96843
2010-02-23 00:59:59 +00:00
Chris Lattner 60680ad316 add a new Push2 opcode for targets (like cellspu) which have
ridiculously ginormous patterns and need more than one byte
of displacement for encodings.  This fixes CellSPU/fdiv.ll.
SPU is still doing something else ridiculous though.

llvm-svn: 96833
2010-02-22 23:55:39 +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