Commit Graph

3504 Commits

Author SHA1 Message Date
Chris Lattner
304a564c1f Add a missing Module::setTargetTriple method.
Remove Function::aiterator and Module::giterator typedefs (and const versions)
as they should have been removed when abegin/gbegin were removed.  Thanks to
alkis for bringing this to my attn.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23978 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-25 17:58:00 +00:00
Jim Laskey
34bd5d5d87 Preparation of supporting scheduling info. Need to find info based on selected
CPU.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23974 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-25 15:15:28 +00:00
Chris Lattner
a542b4c133 Move the END_WITH_NULL marker. Vladimir suggests that this works better with
GCC 4.1.  I tried it with 4.0 and 3.3 and it seems fine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23957 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 05:03:46 +00:00
Chris Lattner
41e087c7e6 Remove a prototype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23951 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 04:13:21 +00:00
Chris Lattner
f753ea7a15 This pass is very old and quite useless, remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23946 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 02:35:24 +00:00
Chris Lattner
71478a09b5 Don't link these three passes in anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23941 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 02:30:25 +00:00
Chris Lattner
d5bc0e5f9c add a proto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23923 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 01:00:32 +00:00
Chris Lattner
efec5e1599 new header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23921 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 00:59:49 +00:00
Chris Lattner
cd04092fe4 add some prototypes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23919 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 00:38:25 +00:00
Chris Lattner
581ba9073e Don't invade the system namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23917 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 00:16:03 +00:00
Chris Lattner
9b2b56ef75 There is no need for this to be VC++ only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23915 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 00:08:51 +00:00
Jeff Cohen
cc94b5178f Work around GCC's dislike of attributes on function definitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23896 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-23 15:22:50 +00:00
Chris Lattner
3e8d596ded Move static functions to .cpp file, reduce #includes, pass strings by
const&.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23890 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-23 05:25:19 +00:00
Jeff Cohen
66c5fd6c53 When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23888 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-23 04:37:20 +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
Chris Lattner
09d3b75af6 add missing prototype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23867 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-21 15:49:28 +00:00
Nate Begeman
405e3ecb56 Invert the TargetLowering flag that controls divide by consant expansion.
Add a new flag to TargetLowering indicating if the target has really cheap
  signed division by powers of two, make ppc use it.  This will probably go
  away in the future.
Implement some more ISD::SDIV folds in the dag combiner
Remove now dead code in the x86 backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23853 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-21 00:02:42 +00:00
Chris Lattner
0692bbd991 add a new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23840 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-20 07:37:59 +00:00
Nate Begeman
d32d4a93f6 Enable targets to say that integer divide is expensive, which will trigger
an upcoming optimization in the DAG Combiner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23834 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-20 02:14:14 +00:00
Chris Lattner
e214979f79 Make this work with the internalize change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23812 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-19 01:41:47 +00:00
Nate Begeman
4a95945fa5 Add the ability to lower return instructions to TargetLowering. This
allows us to lower legal return types to something else, to meet ABI
requirements (such as that i64 be returned in two i32 regs on Darwin/ppc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23802 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-18 23:23:37 +00:00
Chris Lattner
f9c6105a78 add an option to the internalize pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23782 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-18 06:28:16 +00:00
Chris Lattner
40f44f1f58 Fix errors when compiling with -pedantic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23719 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-14 00:33:05 +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
Chris Lattner
b995c5e118 remove a comma to compile with pedantic gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23667 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-08 01:24:19 +00:00
Jeff Cohen
cadee65f54 Remove prolific source of VC++ truncation warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23657 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-07 05:29:25 +00:00
Chris Lattner
d623e953fc add a helper class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23633 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 06:34:34 +00:00
Chris Lattner
40cdedecf5 Change the signature of replaceUsesOfWithOnConstant to take a Use* and not
take the bool.  The bool is always true dynamically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23625 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 18:12:13 +00:00
Chris Lattner
a385bf7b6d Fix case of path
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23605 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 03:32:39 +00:00
Chris Lattner
9390368970 This member can be const too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23600 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 00:21:25 +00:00
Chris Lattner
4c225baa3e Expose the actual valuetype of each register class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23583 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 06:23:19 +00:00
Chris Lattner
f85a55b096 Annotate nodes with their addresses if a graph requests it.
This is Jim's feature implemented so that graphs could 'opt-in' and get
this behavior.  This is currently used by selection dags.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23576 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-01 00:19:21 +00:00
Chris Lattner
37345fe3cd add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23575 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-01 00:17:07 +00:00
Jim Laskey
b78ea801cd Reverting change moving to selection dag graph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23568 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 19:33:41 +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
Jim Laskey
e6e34bc07c Add the node name (thus the address) to node label.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23565 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 19:11:53 +00:00
Chris Lattner
0f21fd5204 Rename MRegisterDesc -> TargetRegisterDesc for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23564 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:49:27 +00:00
Chris Lattner
2f02ed9a1f trim down the target info structs now that we have a preferred spill register class for each callee save register
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23560 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:35:22 +00:00
Chris Lattner
2f9dbe8ee6 expose a new virtual method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23555 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 07:06:37 +00:00
Chris Lattner
294f41d5fc Change these methods to take RC's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23535 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 01:28:14 +00:00
Chris Lattner
615c2d0920 Add FP versions of the binary operators, keeping the int and fp worlds seperate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23506 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 22:29:58 +00:00
Chris Lattner
5e93fbe68c Add a new flag for targets where setjmp/longjmp saves/restores the signal mask,
and _setjmp/_longjmp should be used instead (for llvm.setjmp/llvm.longjmp).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23479 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 22:13:36 +00:00
Chris Lattner
cc0f703f42 allow demotion to volatile values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23472 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 19:38:43 +00:00
Chris Lattner
09f00b1295 Make this slightly more efficient by pushing actual type information down
into the evaluator.  This shrinks a release build of instcombine's text
section from 216363 to 215975 bytes (on PPC).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23468 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 06:38:05 +00:00
Chris Lattner
225e8dd2f5 Split SimpleConstantVal up into its components, so each Constant subclass gets
a different enum value.  This allows 'classof' for these to be really simple,
not needing to call getType() anymore.

This speeds up isa/dyncast/etc for constants, and also makes them smaller.
For example, the text section of a release build of InstCombine.cpp shrinks
from 230037 bytes to 216363 bytes, a 6% reduction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23466 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 06:08:32 +00:00
Chris Lattner
c5406b55d5 add a new function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23443 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 05:26:32 +00:00
Chris Lattner
a58ef7b652 Add long-overdue helpers for getting constants with known upper bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23426 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-24 22:57:28 +00:00
Chris Lattner
8baaa4f0b6 change proto slightly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23420 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-24 08:23:53 +00:00
Chris Lattner
779a6513fe move the live interval headers out of lib/CodeGen/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23399 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-21 04:18:25 +00:00
Chris Lattner
7d3041e060 add a new callback
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23373 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-17 01:02:45 +00:00
Chris Lattner
331a1833e1 new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23314 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-12 17:03:16 +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
Jim Laskey
839615a510 Add help support for -mcpu and -mattr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23222 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-02 19:27:43 +00:00
Chris Lattner
0271077eba Move a bunch of non-deprecated methods above the "deprecated line"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23216 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-02 18:16:20 +00:00
Jeff Cohen
7cd57f4c45 Fix VC++ build errors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23210 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-02 02:51:42 +00:00
Chris Lattner
5ab6f5fe66 Teach live intervals to not crash on dead livein regs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23206 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-02 00:20:32 +00:00
Chris Lattner
7e122db776 Add a new ANY_EXTEND node, which operates like an extension but has undefined
top bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23200 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-02 00:14:40 +00:00
Jim Laskey
b1e1180ca0 1. Use SubtargetFeatures in llc/lli.
2. Propagate feature "string" to all targets.

3. Implement use of SubtargetFeatures in PowerPCTargetSubtarget.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23192 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-01 21:38:21 +00:00
Jim Laskey
b3302db18a This new class provides support for platform specific "features". The intent
is to manage processor specific attributes from the command line.  See examples
of use in llc/lli and PowerPCTargetSubtarget.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23191 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-01 21:36:18 +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
67d2562be7 remove an inappropriate comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23182 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-31 22:49:51 +00:00
Nate Begeman
16d6ea5264 Add support for count trailing zeroes, and population count. These are
needed for folding constants in the upcoming dag combiner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23163 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-31 00:25:01 +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
Nate Begeman
f7f3d32191 Add AssertSext, AssertZext nodes for targets that pass arguments in
registers, and the incoming values have already been zero or sign extended
from the appopriate type to the register width.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23146 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30 02:39:32 +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
74fe063e90 improve comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23134 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-29 22:48:32 +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
Reid Spencer
0f9beca707 Change the names of member variables per Chris' instructions, and document
them more clearly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23118 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-27 19:09:02 +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
050967c4d1 add some forward defs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23100 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 21:06:40 +00:00
Chris Lattner
8fae46675d spell this right!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23097 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:53:44 +00:00
Chris Lattner
a8fbee6f09 Add a hook
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23096 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:53:09 +00:00
Chris Lattner
09321dcf5a Add a new instruction flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23093 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:31:24 +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
Jim Laskey
a2860651e8 Change unsigned lng to unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23077 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 09:24:46 +00:00
Jim Laskey
eb0c36d173 Added cl::bits option type (bit vectors). See "Collecting options as a set
of flags" in the Command Line doc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23067 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 23:31:45 +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
Jim Laskey
6600fa2d17 Recommended to use std::algorithms instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23046 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 16:21:56 +00:00
Jim Laskey
ab6c0a923f Added support for generic linear/binary search.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23044 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 13:32:25 +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
de6a4bc058 rename hasNativeSupportFor* -> is(Operation|Type)Legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23011 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-24 16:34:59 +00:00
Misha Brukman
9e7a601eaf Wrap long lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23009 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-24 14:03:07 +00:00
Reid Spencer
ca09bd0732 Remove some tabs.
Wrap a line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23008 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-24 10:57:30 +00:00
Reid Spencer
0a262ba7c3 For PR616:
These patches make threading optional in LLVM. The configuration scripts are now
modified to accept a --disable-threads switch. If this is used, the Mutex class
will be implemented with all functions as no-op. Furthermore, linking against
libpthread will not be done. Finally, the ParallelJIT example needs libpthread
so its makefile was changed to always add -lpthread to the link line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23003 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-24 10:07:20 +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
ef35ba4f64 add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22985 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-23 21:45:31 +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
Chris Lattner
ae72f4a642 Add a new field to TargetInstrDescriptor for tracking information about
operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22908 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 16:56:26 +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
73bfa71524 Remove the X86 and PowerPC Simple instruction selectors; their time has
passed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22886 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-18 23:53:15 +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
Jim Laskey
1043389135 include/llvm/Support/MathExtras.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22846 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 23:54:12 +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
3a1eff732b Move code dependency for MathExtras.h out of Constants.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22840 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 20:06:22 +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
Jim Laskey
59b8fcfa5f Added support for converting raw bits to FP, and FP to raw bits. The intent
is to avoid the distraction of the union declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22830 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 17:27:47 +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
bb20372e70 add a helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22823 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 06:34:37 +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
f7cc47cdfe remove a dead enum value, making a comment above correct again
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22810 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-16 22:04:58 +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
Chris Lattner
07216eabb7 add a helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22767 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-12 22:13:27 +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
27631a30eb add two helper methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22735 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-09 23:36:18 +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
287921d188 add a new helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22697 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-08 05:21:33 +00:00
Chris Lattner
5ab8363206 Since getSubtarget() always provides a const Subtarget, dont' require the user
to pass it in.  Also, since it always returns a non-null pointer, make it
return a reference instead for easier use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22686 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-05 21:53:21 +00:00
Chris Lattner
9acbd611ec Mark hasConstantValue as a const method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22666 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-05 00:49:06 +00:00
Nate Begeman
c523f4c096 Add an extra parameter that Chris requested
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22665 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-04 23:50:43 +00:00
Nate Begeman
a83ba0f5c9 Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into
BasicBlock's removePredecessor routine.  This requires shuffling around
the definition and implementation of hasContantValue from Utils.h,cpp into
Instructions.h,cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22664 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-04 23:24:19 +00:00
Chris Lattner
2be12faabb Fix an obvious bug in the Log2 stuff that broke SingleSource/UnitTests/2005-05-12-Int64ToFP
last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22630 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-03 20:53:19 +00:00
Chris Lattner
89bfcd34cb Wrap comments to 80 cols, fix code sequence for CountLeadingZeros_64 on
non-ppc GCC 4.0 machines.  Patch by Jim Laskey!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22618 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-03 16:53:58 +00:00
Chris Lattner
865dc8f64f Fix another bug in the clz patch that caused miscompilations when !gcc4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22616 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-03 01:04:40 +00:00
Chris Lattner
e6ec587059 Fix the non-gcc 4.0 paths for countleadingzeros
Patch fixed by Jim Laskey


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22598 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 20:21:33 +00:00
Chris Lattner
591083a5c7 Fix inverted conditionals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 20:06:18 +00:00
Chris Lattner
3b65576527 Fix the non-gcc 4.0 path to compile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22593 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 19:21:51 +00:00
Chris Lattner
88c606eb0c Consolidate all of the various log2 computing functions into MathExtras.h.
Also, provide accelerated implementations when building with GCC.
Patch contributed by Jim Laskey!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22591 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 19:15:30 +00:00
Jeff Cohen
ee841a1a87 Implement SetInterruptFunction for Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22582 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 03:04:47 +00:00
Chris Lattner
e62321ac41 add a new function proto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22577 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 02:13:42 +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
Jeff Cohen
d29b6aa608 Keep tabs and trailing spaces out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22565 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-30 18:33:25 +00:00
Nate Begeman
36f891bdf6 Break SCEVExpander out of IndVarSimplify into its own .h/.cpp file so that
other passes may use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22557 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-30 00:12:19 +00:00
Andrew Lenharth
a00269bc3e support near allocations for the JIT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22554 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-29 23:40:16 +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