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

301 Commits

Author SHA1 Message Date
Evan Cheng
8312ed6f77 Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr  : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
                 "add{l} {$src2, $dst|$dst, $src2}",
                 [(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr  : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
                 "add{l} {$src2, $dst|$dst, $src2}",
                 [(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;

llvm-svn: 40033
2007-07-19 01:14:50 +00:00
Evan Cheng
9593d4ed73 Refactor code to add initial support for OptionalDefOperand.
llvm-svn: 37933
2007-07-06 01:05:26 +00:00
Evan Cheng
2ce6ccab6d Teach DAGISelEmitter about zero_reg.
llvm-svn: 37900
2007-07-05 07:19:45 +00:00
Chris Lattner
efa46b445c silence warning when assertions are disabled.
llvm-svn: 37654
2007-06-19 06:40:46 +00:00
Chris Lattner
39d713e4a5 Fix CodeGen/PowerPC/2007-05-14-InlineAsmSelectCrash.ll, the other recent
patches are also needed.

llvm-svn: 37070
2007-05-15 01:36:44 +00:00
Evan Cheng
0afaeec496 PredicateOperand related bug fix.
llvm-svn: 37060
2007-05-15 01:19:51 +00:00
Evan Cheng
41d7d13158 If a PredicateOperand has an empty ExecuteAlways field, treat it as if a normal operand for isel.
llvm-svn: 36946
2007-05-08 21:04:07 +00:00
Lauro Ramos Venancio
40822aaf24 bugfix: remember that ResNode was declared.
llvm-svn: 36477
2007-04-26 17:03:22 +00:00
Lauro Ramos Venancio
bc32d90b46 Implement "general dynamic", "initial exec" and "local exec" TLS models for
X86 32 bits.

llvm-svn: 36283
2007-04-20 21:38:10 +00:00
Jim Laskey
9d10e4e1fe Make the constant honest.
llvm-svn: 33557
2007-01-26 23:00:54 +00:00
Jim Laskey
1bab68f592 Files missing from LABEL check in.
llvm-svn: 33539
2007-01-26 17:29:20 +00:00
Chris Lattner
135e17b756 Make tblgen error more useful. Patch by B. Scott Michel
llvm-svn: 33295
2007-01-17 07:45:12 +00:00
Bill Wendling
f13d78d3b8 What should be the last unnecessary <iostream>s in the library.
llvm-svn: 32333
2006-12-07 22:21:48 +00:00
Chris Lattner
670eb9da78 Fix PR1001, patch by Nikhil Patil!
llvm-svn: 31880
2006-11-20 18:54:33 +00:00
Chris Lattner
1c86ab0ffe restore some 'magic' code that I removed: it is needed. Add comments explaining
why.

llvm-svn: 31743
2006-11-14 22:17:10 +00:00
Chris Lattner
927a143285 minimal hack to get patterns whose result type is iPTR to be selected.
llvm-svn: 31742
2006-11-14 21:50:27 +00:00
Chris Lattner
1cbfe99b60 remove some dead code
llvm-svn: 31740
2006-11-14 21:41:35 +00:00
Chris Lattner
7e5cbf9ee0 Add support for nodes that return iPTR.
llvm-svn: 31739
2006-11-14 21:32:01 +00:00
Chris Lattner
03cc8c84ef changes to get ptr_rc to be accepted in patterns. This is needed for ppc preinc
stores.

llvm-svn: 31738
2006-11-14 21:18:40 +00:00
Chris Lattner
796d72272b Fix a bug handling nodes with variable arguments. The code was fixed to assume
that there were two input operands before the variable operand portion.  This
*happened* to be true for all call instructions, which took a chain and a
destination, but was not true for the PPC BCTRL instruction, whose destination
is implicit.

Making this code more general allows elimination of the custom selection logic
for BCTRL.

llvm-svn: 31732
2006-11-14 18:41:38 +00:00
Evan Cheng
6921c1c0a7 Divide select methods into groups by SelectionDAG node opcodes (ISD::ADD,
X86ISD::CMP, etc.) instead of SDNode names (add, x86cmp, etc). We now allow
multiple SDNodes to map to the same SelectionDAG node (e.g. store, indexed
store).

llvm-svn: 31575
2006-11-08 23:01:03 +00:00
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