Commit Graph

3719 Commits

Author SHA1 Message Date
Jim Laskey
5bf6f25b4a Add unique id to debug location for debug label use (work in progress.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25096 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 15:04:11 +00:00
Jim Laskey
129e079e06 Add flag for debug presence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25094 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 14:29:26 +00:00
Jim Laskey
a7cea6f599 Tie dwarf generation to darwin assembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25093 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 13:52:30 +00:00
Jim Laskey
780a61cf04 1. Make MachineDebugInfo a pass.
2. Add label uniquing code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25092 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 13:46:37 +00:00
Jim Laskey
2c4ec70233 Move MachineDebugInfo to module level location.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25091 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 13:44:43 +00:00
Chris Lattner
7f7b730d79 Patch #6's in Saem's refactor-the-passmanager patch series. From him:
This sanitises the world, blows away the specialisations and adds
traits per passmanager type -- seemed most natural.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25085 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 07:47:13 +00:00
Chris Lattner
51d6e76ff4 add a comment that I should have written a long time ago
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25084 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 07:29:33 +00:00
Chris Lattner
0df687b1be add a dump method to help debugging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25079 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 05:39:51 +00:00
Nate Begeman
a08787faa8 add support for generating v4i32 code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25043 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-30 00:09:56 +00:00
Duraid Madina
7d0fe1b42a be more polite in public headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25036 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-28 06:47:33 +00:00
Duraid Madina
bd6269c321 undo yuletide naughtyness(tm)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25035 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-28 06:29:38 +00:00
Duraid Madina
4c4e12fb1f more standards compliance (damn, I can't wait for unordered_set (tee hee)
and unordered_map to make it into the standard)

Hurry up, JTC1 SC22 WG21 Library Working Group!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25020 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-26 13:34:00 +00:00
Duraid Madina
bb35a113db I laugh at your dual-core G5s! Fear my precompiled headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25019 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-26 10:34:38 +00:00
Duraid Madina
2abbe867ab i love xmas!!!! *;D*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25016 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-26 08:36:53 +00:00
Chris Lattner
80f55abf00 improve comment: mention vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24971 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-23 00:46:10 +00:00
Chris Lattner
1ac1c4b9d2 add a new node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24969 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-23 00:15:59 +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
03839956e2 Separate the call graph implementation from its interface. This implements
the rough idea sketched out in http://nondot.org/sabre/LLVMNotes/CallGraphClass.txt,
allowing new spiffy implementations of the callgraph interface to be built.

Many thanks to Saem Ghani for contributing this!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24944 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 06:07:52 +00:00
Reid Spencer
65f6ad804e Fix documentation for the AlarmSetup function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24940 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 03:57:15 +00:00
Reid Spencer
b13cf98e6b Implement a generic polled Alarm function. This merely removes the system
dependent portion of the lib/Support/SlowOperationTimer code into the
lib/System implementation where it can be ported to different platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24937 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 03:23:46 +00:00
Jeff Cohen
9337de8651 Oh oh... Unix is case sensitive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24928 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 01:46:59 +00:00
Jeff Cohen
f31a60cd71 Make it compile with VC++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24927 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 01:44:51 +00:00
Reid Spencer
6a2bd74606 Add an eol at the end to shut gcc up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24925 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 01:40:06 +00:00
Evan Cheng
c85b33f264 Added TargetLowering::isMaskedValueZeroForTargetNode() declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24923 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 23:15:41 +00:00
Jim Laskey
9369a5dbc7 Oops llvm namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24913 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 19:46:32 +00:00
Jim Laskey
7f149034e5 Start of Dwarf framework code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24912 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 19:44:40 +00:00
Evan Cheng
7226158d7e Added a hook to print out names of target specific DAG nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24877 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 06:22:03 +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
Jeff Cohen
c5f24a2c2a Fix VC++ level 4 warnings. Because a base class has declared these private, VC++ complains it cannot automatically generate this methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24751 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 00:19:22 +00:00
Jeff Cohen
e15ccf464c Fix VC++ level 4 warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24750 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 00:18:06 +00:00
Jim Laskey
f5395cee6a Added source file/line correspondence for dwarf (PowerPC only at this point.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24748 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-16 22:45:29 +00:00
Reid Spencer
328ead9fce Adjust the constructor to the Linker class to take an argument that names
the module being constructed. This is used to correctly name the module.
Previously the name of the linker tool was used which produces confusing
output when the module identifier is used in an error message.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24699 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-13 20:00:37 +00:00
Chris Lattner
ed13893ff7 Add a couple more fields, move ctor init list to .cpp file, add support
for emitting the ctor/dtor list for common targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24694 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-13 06:32:10 +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
Chris Lattner
8b6cea1b95 Remove a now-dead map, patch by Saem Ghani, thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24629 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-07 05:41:44 +00:00
Sumant Kowshik
f8395ba498 Added comment for removing assert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24623 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-06 18:16:08 +00:00
Sumant Kowshik
14d1d22f37 Handling of zero length last fields in struct used for growing it arbitrarily
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24620 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-06 18:01:20 +00:00
Chris Lattner
767a033a5c Implement external storage for post-order iteration, implementing PR267
Patch by Saem Ghani, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24617 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-06 07:05:27 +00:00
Nate Begeman
8cfa57b1b4 Teach the SelectionDAG ISel how to turn ConstantPacked values into
constant nodes with vector types.  Also teach the asm printer how to print
ConstantPacked constant pool entries.  This allows us to generate altivec
code such as the following, which adds a vector constantto a packed float.

LCPI1_0:  <4 x float> < float 0.0e+0, float 0.0e+0, float 0.0e+0, float 1.0e+0 >
        .space  4
        .space  4
        .space  4
        .long   1065353216      ; float 1
        .text
        .align  4
        .globl  _foo
_foo:
        lis r2, ha16(LCPI1_0)
        la r2, lo16(LCPI1_0)(r2)
        li r4, 0
        lvx v0, r4, r2
        lvx v1, r4, r3
        vaddfp v0, v1, v0
        stvx v0, r4, r3
        blr

For the llvm code:

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24616 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-06 06:18:55 +00:00
Chris Lattner
30614675f4 Add a flag to Module::getGlobalVariable to allow it to return vars with
internal linkage.

Patch provided by Evan Jones, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24604 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-05 05:30:21 +00:00
Nate Begeman
6510b22cec Support multiple ValueTypes per RegisterClass, needed for upcoming vector
work.  This change has no effect on generated code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24563 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-01 04:51:06 +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
Chris Lattner
8bdbb63243 Add a simple clear() method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24543 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 19:31:23 +00:00
Nate Begeman
f43a3ca26d First chunk of actually generating vector code for packed types. These
changes allow us to generate the following code:

_foo:
        li r2, 0
        lvx v0, r2, r3
        vaddfp v0, v0, v0
        stvx v0, r2, r3
        blr

for this llvm:

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24534 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 08:22:07 +00:00
Chris Lattner
7bcd6a36e2 minor cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24528 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 05:26:03 +00:00
Reid Spencer
6ff7240a5c Fix a problem with llvm-ranlib that (on some platforms) caused the archive
file to become corrupted due to interactions between mmap'd memory segments
and file descriptors closing. The problem is completely avoiding by using
a third temporary file.

Patch provided by Evan Jones


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24527 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 05:21:10 +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
Nate Begeman
6a648614e8 Add the majority of the vector machien value types we expect to support,
and make a few changes to the legalization machinery to support more than
16 types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24511 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-29 05:45:29 +00:00
Chris Lattner
d87ef134d7 Fix PR670 and test/Regression/Transforms/Mem2Reg/2005-11-28-Crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24508 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-29 01:07:12 +00:00
Andrew Lenharth
bb227c1b79 Added documented rsprofiler interface. Also remove new profiler passes, the
old ones have been updated to implement the interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24499 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-28 18:00:38 +00:00
Andrew Lenharth
701f5ac73c Random sampling (aka Arnold and Ryder) profiling. This is still preliminary, but it works on spec on x86 and alpha. The idea is to allow profiling passes to remember what profiling they inserted, then a random sampling framework is inserted which consists of duplicated basic blocks (without profiling), such that at each backedge in the program and entry into every function, the framework chooses whether to use the instrumented code or the instrumentation free code. The goal of such a framework is to make it reasonably cheap to do random sampling of very expensive profiling products (such as load-value profiling).
The code is organized into 3 parts (2 passes)
1) a linked set of profiling passes, which implement an analysis group (linked, like alias analysis are).  These insert profiling into the program, and remember what they inserted, so that at a later time they can be queried about any instruction.

2) a pass that handles inserting the random sampling framework.  This also has options to control how random samples are choosen.  Currently implemented are Global counters, register allocated global counters, and read cycle counter (see? there was a reason for it).

The profiling passes are almost identical to the existing ones (block, function, and null profiling is supported right now), and they are valid passes without the sampling framework (hence the existing passes can be unified with the new ones, not done yet).

Some things are a bit ugly still, but that should be fixed up soon enough.

Other todo? making the counter values not "magic 2^16 -1" values, but dynamically choosable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24493 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-28 00:58:09 +00:00
Andrew Lenharth
7c0c567058 Reg2Mem is something a pass may depend on, so allow that
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24488 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-22 22:14:23 +00:00
Nate Begeman
ab48be3772 Check in code to scalarize arbitrarily wide packed types for some simple
vector operations (load, add, sub, mul).

This allows us to codegen:
void %foo(<4 x float> * %a) {
entry:
  %tmp1 = load <4 x float> * %a;
  %tmp2 = add <4 x float> %tmp1, %tmp1
  store <4 x float> %tmp2, <4 x float> *%a
  ret void
}

on ppc as:
_foo:
        lfs f0, 12(r3)
        lfs f1, 8(r3)
        lfs f2, 4(r3)
        lfs f3, 0(r3)
        fadds f0, f0, f0
        fadds f1, f1, f1
        fadds f2, f2, f2
        fadds f3, f3, f3
        stfs f0, 12(r3)
        stfs f1, 8(r3)
        stfs f2, 4(r3)
        stfs f3, 0(r3)
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24484 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-22 18:16:00 +00:00
Chris Lattner
291ca1c563 Add a new flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24480 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-21 23:06:08 +00:00
Chris Lattner
02d09206ee Add some more directives
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24474 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-21 19:51:51 +00:00
Chris Lattner
97e32e3239 add two more config directives, add method for printing constant pool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24463 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-21 08:24:11 +00:00
Chris Lattner
d5ab7e1c54 Make the AsmPrinter keep track of the notion of a function number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24460 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-21 08:12:47 +00:00
Chris Lattner
6fe3acce74 Capitalize methods for better consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24455 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-21 07:51:06 +00:00
Chris Lattner
e2b1f1188f Add section switching to to common AsmPrinter code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24444 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-21 07:05:42 +00:00
Chris Lattner
adb0a068c6 Add a new option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24439 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-21 06:41:08 +00:00
Chris Lattner
006e3e3649 add a new node type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24436 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-20 22:55:57 +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
a35bef9db2 Fix the dominates method to return true if the two nodes are the same. Add
a new properlyDominates method to do what the old one did.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24407 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 07:27:33 +00:00
Nate Begeman
395cba8d41 Teach the type lowering code about turning packed types into vector types.
Next step: generating vector dag nodes, and legalizing them into scalar
code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24404 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 21:44:42 +00:00
Chris Lattner
b13b3801fc add a flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24375 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 07:21:15 +00:00
Chris Lattner
a1ab72daad Teach emitAlignment to handle explicit alignment requests by globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24354 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 19:00:06 +00:00
Chris Lattner
368c36ff32 add malloc_zone_statistics, remove mstats
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24350 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 07:24:17 +00:00
Chris Lattner
0b14259eb2 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24348 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 06:57:34 +00:00
Chris Lattner
4de4123fb1 Shrink derived types by 8 bytes each by not having to have 2 vtables pointers
and other MI overhead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24344 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-13 03:26:12 +00:00
Chris Lattner
1c6a80d31c Refactor some code, moving methods and data around. This gets rid of some
virtual methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24342 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-13 03:13:26 +00:00
Chris Lattner
665d62efdf Shrink the Type class from 32 to 28 bytes on Darwin (which has silly 32-bit
bools).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24326 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 10:07:47 +00:00
Chris Lattner
6dc0b7bea9 remove a dead method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24325 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 08:42:30 +00:00
Chris Lattner
7a13354dde Add support for putting globals in a particular section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24309 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 00:09:49 +00:00
Andrew Lenharth
8b91c77385 added a chain output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24306 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-11 22:48:54 +00:00
Andrew Lenharth
aeef8fc5c6 Add support for a cycle counter intrinsic. As basically all processors have
this and have it in about the same form, I think this makes sense.
on X86, you do a RDTSC (64bit result, from any ring since the P5MMX)
on Alpha, you do a RDCC
on PPC, there is a sequence which may or may not work depending on how things
are setup by the OS.  Or something like that.  Maybe someone who knows PPC
can add support.  Something about the time base register.
on Sparc, you read %tick, which in some solaris versions (>=8) is readable by
userspace
on IA64 read ar.itc

So I think the ulong is justified since all of those are 64bit.
Support is slighly flaky on old chips (P5 and lower) and sometimes
depends on OS (PPC, Sparc).  But for modern OS/Hardware (aka this decade),
we should be ok.

I am still not sure what to do about lowering.  I can either see a lower to 0, to
gettimeofday (or the target os equivalent), or loudly complaining and refusing to
continue.

I am commiting an Alpha implementation.  I will add the X86 implementation if I
have to (I have use of it in the near future), but if someone who knows that
backend (and the funky multi-register results) better wants to add it, it would
take them a lot less time ;)

TODO: better lowering and legalizing, and support more platforms


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24299 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-11 16:45:18 +00:00
Chris Lattner
d35f605613 Allow per-character control over what target assemblers allow in symbol
names.  This also changes the default to allow all of "$_." in addition
to letters and numbers as symbol names.  If you don't want this, use
markCharUnacceptable to remove one of these or markCharAcceptable to add
to the set.  This corresponds with what GAS accepts by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24291 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 21:39:12 +00:00
Chris Lattner
ac8c834288 Add a new option for targets that accept quoted labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24283 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 19:30:07 +00:00
Chris Lattner
6c636c0fff Remove M, which is dead. Eliminate a dead typedef. Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24282 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 19:02:52 +00:00
Chris Lattner
b8c5ec0869 This method is no longer static
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24280 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 18:55:09 +00:00
Chris Lattner
a112e0f447 minor interface changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24276 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 18:46:57 +00:00
Chris Lattner
38b6d78112 add support for .asciz, and enable it by default. If your target assembler
doesn't support .asciz, just set AscizDirective to null in your asmprinter.

This compiles C strings to:

l1__2E_str_1:                           ; '.str_1'
        .asciz  "foo"

instead of:

l1__2E_str_1:                           ; '.str_1'
        .ascii  "foo\000"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24271 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 18:05:57 +00:00
Andrew Lenharth
105b2f5374 needs to go here to apparently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24268 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 02:07:45 +00:00
Andrew Lenharth
183119cdf6 The pass everyone has been waiting for!
Reg2Mem

for fun you can opt -reg2mem -mem2reg


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24267 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 01:58: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
f71e843f65 Switch the operandlist/valuelist from being vectors to being just an array.
This saves 12 bytes from SDNode, but doesn't speed things up substantially
(our graphs apparently already fit within the cache on my g5).  In any case
this reduces memory usage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24248 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-08 22:06:23 +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
df2e425f2a Add a new option to indicate we want the code generator to emit code quickly,
not spending tons of time microoptimizing it.  This is useful for an -O0
style of build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24235 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-08 02:12:47 +00:00
Chris Lattner
cb982916f7 Change a comment slightly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24226 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 17:40:18 +00:00
Nate Begeman
ae232e7a10 Add the necessary support to the ISel to allow targets to codegen the new
alignment information appropriately.  Includes code for PowerPC to support
fixed-size allocas with alignment larger than the stack.  Support for
arbitrarily aligned dynamic allocas coming soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24224 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 09:00:38 +00:00
Chris Lattner
3aef571287 Make sure to initialize the alignment field
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24222 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 08:22:18 +00:00
Chris Lattner
b2f71b12f7 allow functions and modules to have an explicit alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24209 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 06:44:42 +00:00
Chris Lattner
8ae779da70 add an accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24201 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-05 21:58:30 +00:00
Nate Begeman
14b0529532 Add support alignment of allocation instructions.
Add support for specifying alignment and size of setjmp jmpbufs.

No targets currently do anything with this information, nor is it presrved
in the bytecode representation.  That's coming up next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24196 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-05 09:21:28 +00:00
Jeff Cohen
be07f72ca2 <cassert> no longer required to make VC++ happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24177 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-04 02:59:16 +00:00
Duraid Madina
0954038705 change NULL to 0, unbreaks the ppc target when building on ia64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24176 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-04 01:45:04 +00:00
Jim Laskey
7f39c14f52 1. Remove ranges from itinerary data.
2. Tidy up the subtarget emittined code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24172 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-03 22:47:41 +00:00
Jeff Cohen
55d1728ec8 Keep VC++ happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24148 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-02 04:03:16 +00:00
Jim Laskey
6cee630070 Allow itineraries to be passed through the Target Machine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24139 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-01 20:06:59 +00:00
Chris Lattner
3aa4e15331 Remove the LowerConstantExpressionsPass pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24089 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-29 05:32:20 +00:00
Chris Lattner
9a83508a27 remove a dead header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24084 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-29 04:43:10 +00:00
Jim Laskey
15517be4bf Structures used to hold scheduling information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24049 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-27 18:18:05 +00:00
John Criswell
bd9d37026a Move some constant folding functions into LLVMAnalysis since they are used
by Analysis and Transformation passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24038 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-27 16:00:10 +00:00
Jeff Cohen
61b42eb928 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24004 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-26 15:02:21 +00:00
Jeff Cohen
8030c25882 Eliminate use of sed in Visual Studio builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24003 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-26 14:48:53 +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
Chris Lattner
70cfe13f19 Remove some dead argument names which irritates GCC at certain warning levels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23979 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-25 17:59:28 +00:00
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