1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

2382 Commits

Author SHA1 Message Date
John McCall
643489334d Revert r97726 and r97728 at ddunbar's request; we want to solve this
some other way when it comes to be necessary.

llvm-svn: 97972
2010-03-08 20:02:05 +00:00
Chris Lattner
b5555f19f1 Node arguments to type casts can have names too. This code
needs to be majorly refactored, but this spot bugfix allows
things like:

 def vmrghw_shuffle : PatFrag<(ops node:$lhs, node:$rhs),
                             (vector_shuffle (v4i32 node:$lhs), node:$rhs), [{
...

llvm-svn: 97952
2010-03-08 18:36:19 +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
e0c81ed3a4 add some helper functions and implement isContradictory
for CheckValueTypeMatcher.  The isContradictory implementation
helps us factor better, shrinking x86 table from 79144 -> 78896
bytes.

llvm-svn: 97905
2010-03-07 06:29:26 +00:00
Duncan Sands
d18aa07fde If LD_LIBRARY_PATH is set in the system environment, use it.
llvm-svn: 97796
2010-03-05 08:21:02 +00:00
Mikhail Glushenkov
67cac93b81 Make it not an error to specify -O* options several times.
As in 'llvmc -O2 -O2 test.c'.

llvm-svn: 97787
2010-03-05 04:46:39 +00:00
John McCall
45e11bf9a8 Simplify the condition-checking logic and hopefully clear up a build failure
that somehow got through my testing.

llvm-svn: 97728
2010-03-04 11:48:42 +00:00
John McCall
f762d454a4 Teach lit to honor conditional directives. The syntax is:
IF(condition(value)):
If the value satisfies the condition, the line is processed by lit;  otherwise
it is skipped.  A test with no unignored directives is resolved as Unsupported.

The test suite is responsible for defining conditions;  conditions are unary
functions over strings.  I've defined two conditions in the LLVM test suite,
TARGET (with values like those in TARGETS_TO_BUILD) and BINDING (with values
like those in llvm_bindings).  So for example you can write:
  IF(BINDING(ocaml)): RUN: %blah %s -o -
and the RUN line will only execute if LLVM was configured with the ocaml
bindings.

llvm-svn: 97726
2010-03-04 09:36:50 +00:00
Chris Lattner
4f067261b6 so hey, it turns out that the histogram was completely wrong, because
we sometimes emit nodes multiple times to string buffers to size them.
Compute the histogram correctly.

llvm-svn: 97708
2010-03-04 01:34:29 +00:00
Chris Lattner
cf09c9dcef zap fixme.
llvm-svn: 97705
2010-03-04 01:26:00 +00:00
Chris Lattner
72df178091 now that complexpatterns are all emitted at the end of the match
sequence, just emit instruction predicates right before them.  This
exposes yet more factoring opportunitites, shrinking the X86 table 
to 79144 bytes.

llvm-svn: 97704
2010-03-04 01:25:36 +00:00
Chris Lattner
2bbca2de9e change the new isel matcher to emit ComplexPattern matches
as the very last thing before node emission.  This should
dramatically reduce the number of times we do 'MatchAddress'
on X86, speeding up compile time.  This also improves comments
in the tables and shrinks the table a bit, now down to 
80506 bytes for x86.

llvm-svn: 97703
2010-03-04 01:23:08 +00:00
Chris Lattner
87aaa6af4f enhance comment output to specify what recorded slot
numbers a ComplexPat will match into.

llvm-svn: 97696
2010-03-04 00:28:05 +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
Bill Wendling
5a72a97e6b Fix comment.
llvm-svn: 97644
2010-03-03 05:40:40 +00:00
Bill Wendling
959aa1373b Don't turn assertions on by default.
llvm-svn: 97623
2010-03-03 01:13:55 +00:00
Chris Lattner
13bece08fd the sorting predicate should work for comparing an element
to itself, even though this isn't wildly useful.

llvm-svn: 97574
2010-03-02 18:15:02 +00:00
Chris Lattner
3cfdaec84a eliminate CodeGen/DAGISelHeader.h, it is empty now.
llvm-svn: 97556
2010-03-02 06:36:28 +00:00
Chris Lattner
0b41a42411 Rewrite chain handling validation and input TokenFactor handling
stuff now that we don't care about emulating the old broken 
behavior of the old isel.  This eliminates the 
'CheckChainCompatible' check (along with IsChainCompatible) which
did an incorrect and inefficient scan *up* the chain nodes which
happened as the pattern was being formed and does the validation
at the end in HandleMergeInputChains when it forms a structural 
pattern.  This scans "down" the graph, which means that it is
quickly bounded by nodes already selected.  This also handles
token factors that get "trapped" in the dag.

Removing the CheckChainCompatible nodes also shrinks the 
generated tables by about 6K for X86 (down to 83K).

There are two pieces remaining before I can nuke PreprocessRMW:
1. I xfailed a test because we're now producing worse code in a 
   case that has nothing to do with the change: it turns out that
   our use of MorphNodeTo will leave dead nodes in the graph
   which (depending on how the graph is walked) end up causing
   bogus uses of chains and blocking matches.  This is really 
   bad for other reasons, so I'll fix this in a follow-up patch.

2. CheckFoldableChainNode needs to be improved to handle the TF.

llvm-svn: 97539
2010-03-02 02:22:10 +00:00
Chris Lattner
42b5571d38 add some missing \n's
llvm-svn: 97527
2010-03-02 00:13:03 +00:00
Chris Lattner
b1b0f749ed fixme resolved.
llvm-svn: 97517
2010-03-01 23:08:51 +00:00
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
Dan Gohman
eeaf59db09 Add the alignstack keyword.
llvm-svn: 97457
2010-03-01 17:53:39 +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