Commit Graph

696 Commits

Author SHA1 Message Date
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
Reid Spencer
8c4bde36a3 Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23117 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-27 19:06:05 +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
a64d4cddf5 add an enum value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23048 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 17:07:09 +00:00
Chris Lattner
4e27d3a10c Fix a problem Duraid noticed, where we weren't removing values from the kills
list when doing two-address and phi node lowering during register allocation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23043 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 05:45:31 +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
c44fff472c Keep the killed/dead sets sorted, so that "KillsRegister" can do a quick
binary search to test for membership.  This speeds up LLC a bit more on KC++,
e.g. on itanium from 16.6974s to 14.8272s, PPC from 11.4926s to 10.7089s and
X86 from 10.8128s to 9.7943s, with no difference in generated code (like all
of the RA patches).

With these changes, isel is the slowest pass for PPC/X86, but linscan+live
intervals is still > 50% of the compile time for itanium.  More work could
be done, but this is the last for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22993 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-24 00:09:02 +00:00
Chris Lattner
e0cbf970ac Change live variables from using multimaps to using maps of vectors and
rearrange some of the accessors to be more efficient.

This makes it much more efficient to iterate over all of the things with the
same value.  This speeds up liveintervals analysis from 8.63s to 3.79s with
a release build of llc on kc++ with -march=ia64.  This also speeds up live
var from 1.66s -> 0.87s as well, reducing total llc time from 20.1s->15.2s.

This also speeds up other targets slightly, e.g. llc time on X86 from 16.84
-> 16.45s, and PPC from 17.64->17.03s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22990 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-23 23:40:41 +00:00
Chris Lattner
20647a55bf Add RegisterDefIsDead to correspond to KillsRegister, mark both const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22987 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-23 22:43:24 +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
Chris Lattner
66bac3c740 add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22867 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-18 18:44:33 +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
Nate Begeman
0f66a91721 Add two new methods isTargetOpcode() which returns true if the node type
is greater than the range of building selection dag node types, and
getTargetOpcode(), which returns the node opcode less the value of
isd::builtin_op_end, which specifies the end of the builtin types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22844 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 23:44:54 +00:00
Jim Laskey
58b968be85 Move the code dependency for MathExtras.h from SelectionDAGNodes.h.
Added some class dividers in SelectionDAG.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22841 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 20:08:02 +00:00
Jim Laskey
cb6682fa44 Culling out use of unions for converting FP to bits and vice versa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22838 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 19:34:49 +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
8c3484c518 Make removeUser more efficient, add a matching addUser.
Fix the setOperands methods I added to update use/def information correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22832 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 18:58:38 +00:00
Chris Lattner
c809b68357 This was moved to the .cpp file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22827 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 06:46:50 +00:00
Chris Lattner
b467f8af41 make sure to remove a node from the use list of its operands when we replace
it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22820 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 01:54:00 +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
efe5869405 allow passing a dag into getOperationName and dump
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22803 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-16 18:32:18 +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
Nate Begeman
32c392a3a5 Fix the fabs regression on x86 by abstracting the select_cc optimization
out into SimplifySelectCC.  This allows both ISD::SELECT and ISD::SELECT_CC
to use the same set of simplifying folds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22779 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-13 06:00:21 +00:00
Nate Begeman
e5d63829fd Some SELECT_CC cleanups:
1. move assertions for node creation to getNode()
2. legalize the values returned in ExpandOp immediately
3. Move select_cc optimizations from SELECT's getNode() to SELECT_CC's,
   allowing them to be cleaned up significantly.

This paves the way to pick up additional optimizations on SELECT_CC, such
as sum-of-absolute-differences.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22757 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-11 01:12:20 +00:00
Nate Begeman
9373a81e53 Add new node, SELECT_CC. This node is for targets that don't natively
implement SELECT.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22755 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-10 20:51:12 +00:00
Chris Lattner
4cf009f49c I can't believe I caught this before Misha! :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22733 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-09 23:08:53 +00:00
Chris Lattner
7cf7e3f33f Eliminate the SetCCSDNode in favor of a CondCodeSDNode class. This pulls the
CC out of the SetCC operation, making SETCC a standard ternary operation and
CC's a standard DAG leaf.  This will make it possible for other node to use
CC's as operands in the future...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22728 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-09 20:20:18 +00:00
Chris Lattner
e84d2066ce Mark these as V9 specific
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22572 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-01 20:38:31 +00:00
Andrew Lenharth
fe660397e1 new is not a valid default anywhere, so make this pure virtual
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22542 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-28 18:13:59 +00:00
Andrew Lenharth
6a9746127a Like constants, globals on some platforms are GOT relative. This means they have to be allocated
near the GOT, which new doesn't do.  So break out the allocate into a new function.

Also move GOT index handling into JITResolver.  This lets it update the mapping when a Lazy
function is JITed.  It doesn't managed the table, just the mapping.  Note that this is
still non-ideal, as any function that takes a function address should also take a GOT
index, but that is a lot of changes.  The relocation resolve process updates any GOT entry
it sees is out of date.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22537 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-28 12:44:13 +00:00
Jeff Cohen
9eb59ec548 Eliminate tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22520 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 05:53:44 +00:00
Andrew Lenharth
6a6b2dbd3a allow constants to be relocated like GV (necessary for alpha, as constants are relocated with globals, not with .text), and allow targets to have a GOT managed for them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22496 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-22 20:46:42 +00:00
Chris Lattner
56c3261e34 Add two helper methods, adjust a prototype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22456 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-16 17:40:34 +00:00
Chris Lattner
5f9cb59f05 Add ability to set TYPE and FLAGS field for section trivially
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22454 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-16 17:35:26 +00:00
Chris Lattner
5f48ff7d1f Major refactor of the ELFWriter code. Instead of building up one big
vector that represents the .o file at once, build up a vector for each
section of the .o file.  This is needed because the .o file writer needs
to be able to switch between sections as it emits them (e.g. switch
between the .text section and the .rel section when emitting code).

This patch has no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22453 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-16 08:01:13 +00:00
Chris Lattner
39429617e0 Add support for emitting 64-bit integers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22399 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 06:57:26 +00:00
Chris Lattner
f5d507e905 Add some apparently undocumented ELF section header flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22398 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 06:40:29 +00:00