Commit Graph

1011 Commits

Author SHA1 Message Date
Reid Spencer ebd21a425a 80 cols fix.
llvm-svn: 31050
2006-10-19 15:24:04 +00:00
Evan Cheng a74965f15a 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 cfb9526d61 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 1d04dd3aac Really remove dead nodes from isel queue.
llvm-svn: 30923
2006-10-12 23:18:52 +00:00
Evan Cheng 8e770f5589 Use RemoveDeadNode to kill dead node.
llvm-svn: 30917
2006-10-12 20:35:19 +00:00
Evan Cheng d7125583f7 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 2022c79d7f Added properties such as SDNPHasChain to ComplexPattern.
llvm-svn: 30890
2006-10-11 21:02:01 +00:00
Chris Lattner c52dab5894 regenerate
llvm-svn: 30888
2006-10-11 18:13:09 +00:00
Chris Lattner 9d9de698b5 Add support for let expressions around an mdef. This implements a new part
of Regression/TableGen/MultiClass.td.

llvm-svn: 30887
2006-10-11 18:12:44 +00:00
Chris Lattner f405928e86 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 66fbbca1e7 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 75a1b70da8 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 560804cc50 regenerate
llvm-svn: 30799
2006-10-07 07:15:19 +00:00
Chris Lattner dfbda3598d Bugfix: this allows multiclasses to have default arguments.
llvm-svn: 30798
2006-10-07 07:14:48 +00:00
Chris Lattner 8111c59279 Fix more static dtor issues
llvm-svn: 30725
2006-10-04 21:52:35 +00:00
Jim Laskey 05a1947a31 Wrong directory.
llvm-svn: 30669
2006-09-29 17:31:45 +00:00
Jim Laskey 8f1510cfd3 Fix search file for -release.
llvm-svn: 30647
2006-09-28 18:45:11 +00:00
Jim Laskey 68722b7e08 Add support for -release-asserts.
llvm-svn: 30646
2006-09-28 17:49:20 +00:00
Chris Lattner 5d751b4a3a This:
AggregateString += "\0\0";

Doesn't add two nuls to the AggregateString (for obvious reasons), which
broke the asmprinter when the first character of an asm string was not
literal text.

llvm-svn: 30625
2006-09-27 16:44:09 +00:00
Chris Lattner 8d21485660 Actually, name the method PrintSpecial to match other stuff in AsmPrinter.h
llvm-svn: 30618
2006-09-26 23:47:10 +00:00
Chris Lattner 5fd0154523 Add support for ${:foo} syntax, where "foo" is passed into "printSpecial" and
has no associated operand.  This is useful for portably encoding stuff like
the comment character into an asm string.

llvm-svn: 30617
2006-09-26 23:45:08 +00:00
Chris Lattner 7d3fd4f888 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 99ae714459 Fit to 80 columns.
llvm-svn: 30572
2006-09-21 18:28:27 +00:00
Jim Laskey fbeab72759 Trim the home directory from the dejagnu test
llvm-svn: 30519
2006-09-20 09:20:22 +00:00
Evan Cheng 9de003670f Allow PatFrag to be a leaf node.
llvm-svn: 30498
2006-09-19 19:08:04 +00:00
Evan Cheng 00b2848adb Add result of a Xform to isel queue.
llvm-svn: 30497
2006-09-19 18:40:15 +00:00
Chris Lattner bea5f91946 If multiple predicates are listed, they must all pass
llvm-svn: 30476
2006-09-19 00:41:36 +00:00
Chris Lattner bba17b9913 There!
llvm-svn: 30473
2006-09-18 22:41:07 +00:00
Chris Lattner 82a73a1989 Fix Regression/TableGen/2006-09-18-LargeInt.td
llvm-svn: 30472
2006-09-18 22:28:27 +00:00
Jim Laskey ee7929db34 Switching to NewNightlyTest.php
llvm-svn: 30394
2006-09-15 17:03:36 +00:00
Chris Lattner 3ffda067e3 Relax this check.
llvm-svn: 30381
2006-09-14 23:54:24 +00:00
Jim Laskey 5c3bdbad9b No longer used, and confuses maintainers
llvm-svn: 30248
2006-09-11 16:02:58 +00:00
Evan Cheng 1ec61ba00a 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 5a798b0648 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 a2d7d1c4fa Fix JIT encoding of two-addr instructions.
llvm-svn: 30111
2006-09-05 03:01:52 +00:00
Chris Lattner 13a5dcddce Fix a long-standing wart in the code generator: two-address instruction lowering
actually *removes* one of the operands, instead of just assigning both operands
the same register.  This make reasoning about instructions unnecessarily complex,
because you need to know if you are before or after register allocation to match
up operand #'s with the target description file.

Changing this also gets rid of a bunch of hacky code in various places.

This patch also includes changes to fold loads into cmp/test instructions in
the X86 backend, along with a significant simplification to the X86 spill
folding code.

llvm-svn: 30108
2006-09-05 02:12:02 +00:00
Chris Lattner 70fd01a1b8 Make sure to clear CurDefmPrefix = 0, otherwise stuff after a defm won't
parse right.  This fixes TableGen/MultiClass.td

llvm-svn: 30037
2006-09-01 22:07:27 +00:00
Chris Lattner c05fac8b83 fix an assertion with multidefs. Def inside of multiclasses don't need to
be complete.

llvm-svn: 30034
2006-09-01 21:59:03 +00:00
Chris Lattner aec1af2239 regenerate
llvm-svn: 30029
2006-09-01 21:14:42 +00:00
Chris Lattner 66b7235877 Add often-requested support for defining "multiclasses" which can be instantiated.
This allows you to define multiple definitions with one line, encouraging
more .td file factoring.

llvm-svn: 30027
2006-09-01 21:13:49 +00:00
Evan Cheng 9b675bd769 Issue cvs co with -P option to prune empty directories. Remove the unnecessary
update stage.

llvm-svn: 29955
2006-08-29 18:01:18 +00:00
Reid Spencer 97c598083e Add virtual methods to all subclasses so they are not overloaded.
llvm-svn: 29930
2006-08-28 00:12:25 +00:00
Chris Lattner 251468e9d0 Use compiler.h instead of hand rolling our own macro
llvm-svn: 29913
2006-08-27 13:16:24 +00:00
Evan Cheng 44ce57d5c2 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 34b70eea5c SelectNodeTo now returns a SDNode*.
llvm-svn: 29901
2006-08-26 08:00:10 +00:00
Evan Cheng b7b5ba5aaf Minor getCopyToReg() call change.
llvm-svn: 29900
2006-08-26 07:39:28 +00:00
Evan Cheng 61413a3d72 Select() no longer require Result operand by reference.
llvm-svn: 29898
2006-08-26 05:34:46 +00:00
Evan Cheng a8b2b6c7ff Remove dead code.
llvm-svn: 29897
2006-08-26 01:34:15 +00:00
Evan Cheng eaf9fba2ff A bit more clean up.
llvm-svn: 29893
2006-08-26 01:02:19 +00:00
Evan Cheng 548bd0dc95 - 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