1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
Commit Graph

280 Commits

Author SHA1 Message Date
Evan Cheng
42fb21c3c5 Always pass the root node to ComplexPattern isel matching function.
llvm-svn: 31570
2006-11-08 20:31:10 +00:00
Chris Lattner
8dac4564af Parse PredicateOperand's. When an instruction takes one, have the generated
isel fill in the instruction operands with the 'execute always' value
automatically.

llvm-svn: 31448
2006-11-04 05:12:02 +00:00
Chris Lattner
f7ad33f01b First steps to getting PredicateOperand's to work. This handles instruction
and pat pattern definitions.  Codegen is not right for them yet.

llvm-svn: 31444
2006-11-04 01:35:50 +00:00
Chris Lattner
71ce2c5de5 silence warnings
llvm-svn: 31392
2006-11-03 01:11:05 +00:00
Reid Spencer
01f5071a4d Revert last patch which causes tblgen to segfault (why, I'm not sure).
llvm-svn: 31383
2006-11-02 21:07:40 +00:00
Reid Spencer
0d18610609 For PR786:
Remove unused variables.

llvm-svn: 31381
2006-11-02 20:46:16 +00:00
Evan Cheng
a585562f95 Not meant to be checked in.
llvm-svn: 31334
2006-11-01 00:27:59 +00:00
Evan Cheng
c566892bd5 Add operand constraints to TargetInstrInfo.
llvm-svn: 31333
2006-11-01 00:27:05 +00:00
Evan Cheng
f872538d4b Passing isel root and use operands to ComplexPattern functions, these should do the usual load folding checks as well.
llvm-svn: 30972
2006-10-16 06:33:44 +00:00
Evan Cheng
513dc7ed5f When checking if a load can be folded, we check if there is any non-direct
way to reach the load via any nodes that would be folded. Start from the
root of the matched sub-tree.

llvm-svn: 30956
2006-10-14 08:30:15 +00:00
Evan Cheng
c7283044d1 Really remove dead nodes from isel queue.
llvm-svn: 30923
2006-10-12 23:18:52 +00:00
Evan Cheng
5ff49d9410 Use RemoveDeadNode to kill dead node.
llvm-svn: 30917
2006-10-12 20:35:19 +00:00
Evan Cheng
65264c811f Prior load folding check on chain operand was too strict. It requires the
chain operand to point to the load being folded. Now we relax this, traversing
up the chain, if it doesn't reach the load, then it's ok. We will create a
TokenFactor (of all the chain operands and the load's chain) to capture all
the control flow dependencies.

llvm-svn: 30897
2006-10-12 02:08:53 +00:00
Evan Cheng
7a185e0164 Added properties such as SDNPHasChain to ComplexPattern.
llvm-svn: 30890
2006-10-11 21:02:01 +00:00
Chris Lattner
822d1b259e Special case tblgen generated code for patterns like (and X, 255) or (or X, 42).
The dag/inst combiners often 'simplify' the masked value based on whether
or not the bits are live or known zero/one.  This is good and dandy, but
often causes special case patterns to fail, such as alpha's CMPBGE pattern,
which looks like "(set GPRC:$RC, (setuge (and GPRC:$RA, 255), (and GPRC:$RB, 255)))".
Here the pattern for (and X, 255) should match actual dags like (and X, 254) if
the dag combiner proved that the missing bits are already zero (one for 'or').

For CodeGen/Alpha/cmpbge.ll:test2 for example, this results in:

        sll $16,1,$0
        cmpbge $0,$17,$0
        ret $31,($26),1

instead of:

        sll $16,1,$0
        and $0,254,$0
        and $17,255,$1
        cmpule $1,$0,$0
        ret $31,($26),1

... and requires no target-specific code.

llvm-svn: 30871
2006-10-11 04:05:55 +00:00
Chris Lattner
ad597308ad Split some code out into a new method. The generated code is exactly
identical, this is just a refactoring.

llvm-svn: 30868
2006-10-11 03:35:34 +00:00
Evan Cheng
084d415941 Predicate function on the node should be matched before its childrean' matching
code. This is especially important now matching ISD::LOAD also requires a
Predicate_Load call.

llvm-svn: 30845
2006-10-09 21:02:17 +00:00
Chris Lattner
86f1992481 don't allow 'imm' or specific imms, like '1' on the LHS of a binop.
This shrinks X86GenDAGISel by ~330 lines.

llvm-svn: 30574
2006-09-21 20:46:13 +00:00
Chris Lattner
28d7124afb Fit to 80 columns.
llvm-svn: 30572
2006-09-21 18:28:27 +00:00
Evan Cheng
c5be7540d2 Allow PatFrag to be a leaf node.
llvm-svn: 30498
2006-09-19 19:08:04 +00:00
Evan Cheng
f020ff9440 Add result of a Xform to isel queue.
llvm-svn: 30497
2006-09-19 18:40:15 +00:00
Chris Lattner
87d05ea43b If multiple predicates are listed, they must all pass
llvm-svn: 30476
2006-09-19 00:41:36 +00:00
Chris Lattner
7498e29ca4 There!
llvm-svn: 30473
2006-09-18 22:41:07 +00:00
Chris Lattner
b54881691d Fix Regression/TableGen/2006-09-18-LargeInt.td
llvm-svn: 30472
2006-09-18 22:28:27 +00:00
Chris Lattner
8b65094e0f Relax this check.
llvm-svn: 30381
2006-09-14 23:54:24 +00:00
Evan Cheng
f82eb13e3b 1) With X86 lowering change, the following can no longer happen since
the branch's chain is also produced by cmp.
          [ch, r : ld]
             ^ ^
             | |
      [XX]--/   \- [flag : cmp]
       ^             ^
       |             |
       \---[br flag]-

Remove an isel check which prevents loads from being folded into cmp / test
instructions.

2) Whenever possible, delete a selected node to allow more load folding
opportunities. Note not all nodes can be deleted after it has been
selected. Some may have simply morphed; some have not changed at all (e.g.
EntryToken).

llvm-svn: 30242
2006-09-11 02:24:43 +00:00
Evan Cheng
9d17d65cc4 Generated isel should favors explicit constant operand (+2) over an operand with a predicate (+1).
llvm-svn: 30180
2006-09-08 07:26:39 +00:00
Chris Lattner
7890c00e2c Use compiler.h instead of hand rolling our own macro
llvm-svn: 29913
2006-08-27 13:16:24 +00:00
Evan Cheng
10a7268b85 Do not emit getTargetNode() and SelectNodeTo() which takes more than 3
SDOperand arguments. Use the variants which take an array and number instead.

llvm-svn: 29906
2006-08-27 08:11:28 +00:00
Evan Cheng
1c3d571e4b SelectNodeTo now returns a SDNode*.
llvm-svn: 29901
2006-08-26 08:00:10 +00:00
Evan Cheng
36c38110c4 Minor getCopyToReg() call change.
llvm-svn: 29900
2006-08-26 07:39:28 +00:00
Evan Cheng
2db7799507 Select() no longer require Result operand by reference.
llvm-svn: 29898
2006-08-26 05:34:46 +00:00
Evan Cheng
930bc5331d Remove dead code.
llvm-svn: 29897
2006-08-26 01:34:15 +00:00
Evan Cheng
2cc7e2ce0c A bit more clean up.
llvm-svn: 29893
2006-08-26 01:02:19 +00:00
Evan Cheng
b96b719724 - Clean up tablegen dag isel generator code.
- Clean up the code generated by tablegen:
  * AddToISelQueue now takes one argument.
  * ComplexPattern matching condition can now be shared.
  * Eliminate passing unnecessary arguments to emit routines.
  * Eliminate some unneeded SDOperand declarations in select routines.
  * Other minor clean ups.
- This reduces foot print slightly: X86ISelDAGToDAG.o is reduced from 971k
  to 823k.

llvm-svn: 29892
2006-08-26 00:59:04 +00:00
Evan Cheng
7fb75bbc8d SelectNodeTo() may return a SDOperand that is different from the input.
llvm-svn: 29726
2006-08-16 07:30:09 +00:00
Chris Lattner
9611f01574 The generated runloop shouldn't require Select to update 'Result'. In fact
we'd like to remove result entirely.

llvm-svn: 29713
2006-08-15 23:42:26 +00:00
Chris Lattner
3771e3035f allow Select to return the node being selected if RAU isn't needed.
llvm-svn: 29712
2006-08-15 23:27:50 +00:00
Evan Cheng
963d61dc86 Use SmallVector instead.
llvm-svn: 29619
2006-08-11 18:33:41 +00:00
Evan Cheng
5950c56f73 - Prevent some functions from being inlined to eliminate the code size bloat
introduced by previous commit.
- SelectCode now returns a SDNode*. If it is not null, the selected node
  produces the same number of results as the input node. The seletion loop
  is responsible for calling ReplaceAllUsesWith() to replace the input node
  with the output target node. For other cases, e.g. when load is folded,
  the selection code is responsible for calling ReplaceAllUsesOfValueWith()
  and SelectCode returns NULL.
- Other clean ups.

llvm-svn: 29602
2006-08-11 08:59:35 +00:00
Chris Lattner
947ac60771 Revert previous patch
llvm-svn: 29585
2006-08-09 16:44:44 +00:00
Tanya Lattner
3707c6e4e3 Reverting back to original 1.8 version so I can manually merge in patch.
llvm-svn: 29584
2006-08-09 16:41:21 +00:00
Chris Lattner
7b1362fa52 Start eliminating temporary vectors used to create DAG nodes. Instead, pass
in the start of an array and a count of operands where applicable.  In many
cases, the number of operands is known, so this static array can be allocated
on the stack, avoiding the heap.  In many other cases, a SmallVector can be
used, which has the same benefit in the common cases.

I updated a lot of code calling getNode that takes a vector, but ran out of
time.  The rest of the code should be updated, and these methods should be
removed.

We should also do the same thing to eliminate the methods that take a
vector of MVT::ValueTypes.

It would be extra nice to convert the dagiselemitter to avoid creating vectors
for operands when calling getTargetNode.

llvm-svn: 29566
2006-08-08 02:23:42 +00:00
Evan Cheng
c6627fc5d7 Making TableGen'd instruction selection code non-recursive. This fixes PR805.
llvm-svn: 29548
2006-08-07 22:17:58 +00:00
Chris Lattner
6f475f0904 Remove some extraneous newlines.
llvm-svn: 29492
2006-08-03 00:42:26 +00:00
Chris Lattner
8afa040b03 Really add support for compilers without noinline
llvm-svn: 29491
2006-08-03 00:26:13 +00:00
Evan Cheng
64b9364083 Pass N by reference to select functions to prevent gcc from allocating more stack.
llvm-svn: 29423
2006-08-01 01:07:48 +00:00
Evan Cheng
1335c08549 Remove an unneeded match condition: the type check for root node has been
moved to outside the actual select routine.

llvm-svn: 29415
2006-07-31 19:01:58 +00:00
Evan Cheng
09f9f995f5 Split each select function for a particular opcode into multiple ones. One
per possible ValueType of the node. e.g. Select_add is split into Select_add_i8,
Select_add_i16, etc.

For opcodes which do not produce a non-chain result, it is split on the
ValueType of its first non-chain operand. e.g. Select_store.

On X86 / Mac OS X, Select_store used to be the largest function. It had a stack
frame size of 8.5k. Now the largest one is Store_i32 with a frame size of 3.1k.

llvm-svn: 29404
2006-07-28 22:51:01 +00:00
Evan Cheng
1ffea6db32 Clean up.
llvm-svn: 29378
2006-07-28 01:19:22 +00:00