Commit Graph

85 Commits

Author SHA1 Message Date
Evan Cheng
4e4937836e Yet another getTargetNode() variant. I promise one of these days I'll fix
tblgen so this is unnecessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-17 00:32:38 +00:00
Evan Cheng
909addffc3 New getNode() variants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25156 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-09 18:29:18 +00:00
Jim Laskey
b2efb853f0 Applied some recommend changes from sabre. The dominate one beginning "let the
pass manager do it's thing."  Fixes crash when compiling -g files and suppresses
dwarf statements if no debug info is present.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25100 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 22:28:25 +00:00
Chris Lattner
002d83418a remove a dead node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24966 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 21:16:35 +00:00
Duraid Madina
3cb51f9754 i need to do this to take over the earth
when I take over the earth, sabre will be happy because i'll stop asking
him silly questions!!!!!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24949 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 07:02:51 +00:00
Chris Lattner
bc149b2c98 Add an accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24831 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 21:00:53 +00:00
Evan Cheng
05a4c35494 Yet another variant of getTargetNode().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24758 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 01:44:51 +00:00
Evan Cheng
7038daf342 Added new getNode and getTargetNode variants for X86 stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24653 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-10 00:37:58 +00:00
Evan Cheng
ab24ed2a32 Added patterns for ADD8rm, etc. These fold load operands. e.g. addb 4(%esp), %al
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24648 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-09 22:48:48 +00:00
Evan Cheng
0fc7198890 Added support for ComplexPattern. These are patterns that require C++ pattern
matching code that is not currently auto-generated by tblgen, e.g. X86
addressing mode. Selection routines for complex patterns can return multiple operands, e.g. X86 addressing mode returns 4.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24634 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-08 02:00:36 +00:00
Evan Cheng
66a48bbc35 Teach tblgen to accept register source operands in patterns, e.g.
def SHL8rCL  : I<0xD2, MRM4r, (ops R8 :$dst, R8 :$src),
                 "shl{b} {%cl, $dst|$dst, %CL}",
                 [(set R8:$dst, (shl R8:$src, CL))]>, Imp<[CL],[]>;

This generates a CopyToReg operand and added its 2nd result to the shl as
a flag operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24557 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-01 00:18:45 +00:00
Chris Lattner
eb19e40efb Make SelectNodeTo return N
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24548 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 22:45:14 +00:00
Evan Cheng
14229bb636 Fixed a bug introduced by my last commit: TargetGlobalValues should key on
GlobalValue * and index pair. Update getGlobalAddress() for symmetry.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24524 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 02:49:21 +00:00
Evan Cheng
61ca74bc3a Added an index field to GlobalAddressSDNode so it can represent X+12, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 02:04:11 +00:00
Chris Lattner
47725d059b Add support for a new STRING and LOCATION node for line number support, patch
contributed by Daniel Berlin, with a few cleanups here and there by me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24512 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-29 06:15:39 +00:00
Chris Lattner
8f3366ad27 Add two new construction methods, patch by Evan Cheng
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24417 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 01:42:10 +00:00
Nate Begeman
5fbb5d2459 Teach LLVM how to scalarize packed types. Currently, this only works on
packed types with an element count of 1, although more generic support is
coming.  This allows LLVM to turn the following code:

void %foo(<1 x float> * %a) {
entry:
  %tmp1 = load <1 x float> * %a;
  %tmp2 = add <1 x float> %tmp1, %tmp1
  store <1 x float> %tmp2, <1 x float> *%a
  ret void
}

Into:

_foo:
        lfs f0, 0(r3)
        fadds f0, f0, f0
        stfs f0, 0(r3)
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24416 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 00:36:38 +00:00
Chris Lattner
b80e2be889 Switch the allnodes list from a vector of pointers to an ilist of nodes.
This eliminates the vector, allows constant time removal of a node from
a graph, and makes iteration over the all nodes list stable when adding
nodes to the graph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24262 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-09 23:46:43 +00:00
Chris Lattner
109654fae9 Change the ValueList array for each node to be shared instead of individually
allocated.  Further, in the common case where a node has a single value, just
reference an element from a small array.  This is a small compile-time wi.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24250 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-08 23:30:11 +00:00
Chris Lattner
f0e80cf909 adjust itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24242 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-08 18:52:57 +00:00
Chris Lattner
753c8f20e4 Add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23989 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-25 21:02:21 +00:00
Andrew Lenharth
2a2de66db2 add TargetExternalSymbol
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23886 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-23 03:40:17 +00:00
Nate Begeman
ced9d5dcd3 SimplifySelectCC is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23705 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 03:10:46 +00:00
Jim Laskey
453d21e66c Added allnodes_size for scheduling support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23567 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 19:27:01 +00:00
Chris Lattner
fde3f3061d Add a new argument to ReplaceAllUsesWith to keep track of nodes deleted by
this method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23254 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-07 05:36:18 +00:00
Chris Lattner
ab2eb66f07 add a map for nullary ops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23223 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-02 19:35:42 +00:00
Nate Begeman
1d4d414111 First pass at the DAG Combiner. It isn't used anywhere yet, but it should
be mostly functional.  It currently has all folds from SelectionDAG.cpp
that do not involve a condition code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23184 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-01 00:19:25 +00:00
Chris Lattner
d6a80778e5 Allow physregs to occur in the dag with multiple types. Though I don't like
this, it is a requirement on PPC, which can have an f32 value in r3 at one
point in a function and a f64 value in r3 at another point.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23160 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 22:38:05 +00:00
Chris Lattner
e3f1026683 add some method variants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23142 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 01:56:13 +00:00
Chris Lattner
ba8a0e0d7f Add a new API for nate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23132 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-29 22:00:00 +00:00
Chris Lattner
26005b1b67 Add a new version of ReplaceAllUsesWith, make the comments more useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23086 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 18:35:58 +00:00
Chris Lattner
5839bf2b3b Change ConstantPoolSDNode to actually hold the Constant itself instead of
putting it into the constant pool.  This allows the isel machinery to
create constants that it will end up deciding are not needed, without them
ending up in the resultant function constant pool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23081 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 17:15:30 +00:00
Chris Lattner
2bb06cdf27 Fix a huge annoyance: SelectNodeTo took types before the opcode unlike
every other SD API.  Fix it to take the opcode before the types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23079 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 16:36:26 +00:00
Chris Lattner
3cd82619a8 add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23049 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 17:24:09 +00:00
Chris Lattner
aaaaf79d4a Add support for TargetConstantPool node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23040 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 05:02:41 +00:00
Chris Lattner
afb2dd43de add a new TargetFrameIndex node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23035 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 00:43:01 +00:00
Chris Lattner
7651fa4a7e add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23027 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-24 23:00:29 +00:00
Chris Lattner
420089c47c add two new methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23024 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-24 22:43:53 +00:00
Chris Lattner
4fbde4d871 add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22958 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-21 22:30:42 +00:00
Chris Lattner
c3aea74ae5 ADd a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22954 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-21 19:48:53 +00:00
Chris Lattner
d54209fcf9 Add 5-operand version of SelectNodeTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22950 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-21 18:49:58 +00:00
Chris Lattner
f6b184981e ADd support for TargetGlobalAddress nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22939 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 22:31:34 +00:00
Nate Begeman
5ce0d308e6 Add support for target nodes with more than 3 operands, required by ppc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22894 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 00:56:28 +00:00
Nate Begeman
294a0a103d Add support for target DAG nodes that take 4 operands, such as PowerPC's
rlwinm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22856 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-18 07:30:15 +00:00
Chris Lattner
6542d95060 add ReplaceAllUsesWith, and a helper to implemented it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22833 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 18:59:17 +00:00
Chris Lattner
056f9f61d0 add some helper methods, and a new TargetConstant node, which is not
subjected to folding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22812 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 00:33:30 +00:00
Chris Lattner
d5d0f9bd20 Eliminate the RegSDNode class, which 3 nodes (CopyFromReg/CopyToReg/ImplicitDef)
used to tack a register number onto the node.

Instead of doing this, make a new node, RegisterSDNode, which is a leaf
containing a register number.  These three operations just become normal
DAG nodes now, instead of requiring special handling.

Note that with this change, it is no longer correct to make illegal
CopyFromReg/CopyToReg nodes.  The legalizer will not touch them, and this
is bad, so don't do it. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22806 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-16 21:55:35 +00:00
Nate Begeman
7cbd525ba8 Implement BR_CC and BRTWOWAY_CC. This allows the removal of a rather nasty
fixme from the PowerPC backend.  Emit slightly better code for legalizing
select_cc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22805 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-16 19:49:35 +00:00
Chris Lattner
1b95095857 add some methods for dag->dag isel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22800 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-16 18:16:24 +00:00
Nate Begeman
ff66368a5f Remove an unncessary argument to SimplifySelectCC and add an additional
assert when creating a select_cc node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22780 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-13 06:14:17 +00:00