Commit Graph

12117 Commits

Author SHA1 Message Date
Chris Lattner fae8afb77f Unbreak the build :(
llvm-svn: 25124
2006-01-06 05:47:48 +00:00
Evan Cheng 53dd0ac226 Addd (shl x, 1) ==> (shl x, x) peepholes.
llvm-svn: 25123
2006-01-06 02:31:59 +00:00
Evan Cheng 85c973cda9 Revert the previous check-in. Leave shl x, 1 along for target to deal with.
llvm-svn: 25121
2006-01-06 01:56:02 +00:00
Evan Cheng b03f9b32d2 fold (shl x, 1) -> (add x, x)
llvm-svn: 25120
2006-01-06 01:06:31 +00:00
Chris Lattner b87030358d linkonce symbols have an extra indirection, just like weak ones do. This fixes
Prolangs-C++/family and Prolangs-C++/primes.

llvm-svn: 25119
2006-01-06 01:04:03 +00:00
Evan Cheng 172fce7050 * Fast call support.
* FP cmp, setcc, etc.

llvm-svn: 25117
2006-01-06 00:43:03 +00:00
Evan Cheng f35b1c837f Support for custom lowering of ISD::RET.
llvm-svn: 25116
2006-01-06 00:41:43 +00:00
Chris Lattner 20c88dfd1b Fix a compile crash building MultiSource/Applications/d with the new front-end.
The PPC backend was generating random shift counts in this case, due to an
uninitialized variable.

llvm-svn: 25114
2006-01-05 18:32:49 +00:00
Chris Lattner fed8ceb56a Implement a few symbolic constant folding things. X ? Y : Y is Y.
Fold:
seteq ({ short }* cast (int 1 to { short }*), { short }* null)
setlt ({ short }* cast (int 1 to { short }*), { short }* cast (int 2 to { short }*))

to false/true.  These last two commonly occur in the output of compilers that
tag integers, like cozmic's scheme compiler.

Tested by Regression/Assembler/ConstantExprFold.llx

llvm-svn: 25112
2006-01-05 07:49:30 +00:00
Chris Lattner 0f7e9f5180 fix some formatting problems
llvm-svn: 25110
2006-01-05 07:19:51 +00:00
Chris Lattner da56ae98a9 unbreak the build, these are now in TargetSelectionDAG.td
llvm-svn: 25109
2006-01-05 04:48:15 +00:00
Evan Cheng a5ae6e8320 Added ConstantFP patterns.
llvm-svn: 25108
2006-01-05 02:08:37 +00:00
Evan Cheng e0d1b65d24 Added fpimm node for ConstantFP.
llvm-svn: 25107
2006-01-05 02:07:49 +00:00
Jim Laskey deeafa0f00 Had expand logic backward.
llvm-svn: 25105
2006-01-05 01:47:43 +00:00
Jim Laskey 762e9ec06c Added initial support for DEBUG_LABEL allowing debug specific labels to be
inserted in the code.

llvm-svn: 25104
2006-01-05 01:25:28 +00:00
Evan Cheng 45e19098a6 DAG based isel call support.
llvm-svn: 25103
2006-01-05 00:27:02 +00:00
Evan Cheng 779dd94721 Remove some dead code.
llvm-svn: 25102
2006-01-05 00:26:14 +00:00
Jim Laskey 219d559824 Applied some recommend changes from sabre. The dominate one beginning "let the
pass manager do it's thing."  Fixes crash when compiling -g files and suppresses
dwarf statements if no debug info is present.

llvm-svn: 25100
2006-01-04 22:28:25 +00:00
Jim Laskey 0da76a676a Add unique id to debug location for debug label use (work in progress.)
llvm-svn: 25096
2006-01-04 15:04:11 +00:00
Jim Laskey 2741e8304c Add check for debug presence.
llvm-svn: 25095
2006-01-04 14:30:12 +00:00
Jim Laskey b0609d91c3 Tie dwarf generation to darwin assembler.
llvm-svn: 25093
2006-01-04 13:52:30 +00:00
Jim Laskey 57a5e0b45a Moving MachineDebugInfo to module level location.
llvm-svn: 25090
2006-01-04 13:43:56 +00:00
Jim Laskey 6f9ff633a6 Change how MachineDebugInfo is fetched.
llvm-svn: 25089
2006-01-04 13:42:59 +00:00
Jim Laskey 44317393f8 Extending MachineDebugInfo.
llvm-svn: 25086
2006-01-04 13:36:38 +00:00
Chris Lattner c47b08154d 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.

llvm-svn: 25085
2006-01-04 07:47:13 +00:00
Chris Lattner 227e936650 Add support for targets (like Alpha) that have terminator instructions which
use virtual registers.  We now allow the first instruction in a block of
terminators to use virtual registers, and update phi elimination to correctly
update livevar when eliminating phi's.  This fixes a problem on a testcase
Andrew sent me.

llvm-svn: 25083
2006-01-04 07:12:21 +00:00
Chris Lattner 0511055276 Add an assertion, update DefInst even though no one uses it (dangling pointers
don't help anyone)

llvm-svn: 25081
2006-01-04 06:47:48 +00:00
Chris Lattner be45b5e948 Add a LiveVariables::VarInfo::dump method
llvm-svn: 25080
2006-01-04 05:40:30 +00:00
Chris Lattner 3f60c83911 Saem's patch #5 of the passmanager refactoring
llvm-svn: 25078
2006-01-04 05:02:04 +00:00
Chris Lattner afb8ee6d25 patch #4 in Saem's passmanager refactoring.
llvm-svn: 25077
2006-01-04 04:36:11 +00:00
Chris Lattner 6b52be6a89 implement constant folding of ==/!= on constant packed, simplify some code.
llvm-svn: 25074
2006-01-04 02:20:54 +00:00
Chris Lattner f0f4068196 implement constant folding for the element-wise binary operations
llvm-svn: 25073
2006-01-04 02:15:02 +00:00
Chris Lattner 1171d95d88 don't crash when trying to constant fold packed expressions.
llvm-svn: 25072
2006-01-04 02:03:29 +00:00
Chris Lattner c421a26792 Fix an assertion to allow constant folding of packed values
llvm-svn: 25071
2006-01-04 01:01:04 +00:00
Chris Lattner 8cdc773748 Pull inline methods out of the pass class definition to make it easier to
read the code.

Do not internalize debugger anchors.

llvm-svn: 25067
2006-01-03 19:13:17 +00:00
Chris Lattner 6c10dee2fa silence some warnings
llvm-svn: 25066
2006-01-03 17:52:18 +00:00
Chris Lattner b723c33614 Change a variable from being an iterator to a raw MachineInstr*, to make
GDB use tolerable

llvm-svn: 25064
2006-01-03 07:41:37 +00:00
Chris Lattner 4700d9a9cf Finally commit Saem's 'patch #3' to refactor the pass manager
llvm-svn: 25063
2006-01-03 07:05:17 +00:00
Chris Lattner 44497859f9 Make the -print-alias-sets pass work for printing out something other than
the default aa impl results.

llvm-svn: 25062
2006-01-03 06:05:22 +00:00
Andrew Lenharth eaf5ed1438 typeo
llvm-svn: 25060
2006-01-02 21:15:53 +00:00
Chris Lattner 38e0b281da Remove a 'using namespace std'.
llvm-svn: 25059
2006-01-01 22:20:31 +00:00
Andrew Lenharth f99c338278 Add support for brcond
llvm-svn: 25058
2006-01-01 22:16:43 +00:00
Andrew Lenharth 6bec63aac9 Move brcond over and fix some imm patterns. This may be the last change before changing the default alpha isel.
llvm-svn: 25057
2006-01-01 22:16:14 +00:00
Andrew Lenharth f0545f7c48 clean this function up some
llvm-svn: 25055
2006-01-01 22:13:54 +00:00
Chris Lattner 5916d7b6b1 Patch #1 of Saem Ghani's Pass Manager refactoring. From the man:
"All this should do is create what will eventually be the specialised
passmanagers.  Currently, the templates are inheriting them, once the
template specialisations' methods have been absorbed, patches
submitted method by method.  I'll nuke the specialisations and have
the new objects inherit directly from passmanagert, and sanitise the
world of all references to templates.
"

llvm-svn: 25053
2005-12-30 20:00:46 +00:00
Andrew Lenharth 60ab61fcfc improve constant loading. Still sucks, but oh well
llvm-svn: 25047
2005-12-30 02:30:02 +00:00
Nate Begeman 336dba6fb1 Add support for generating v4i32 altivec code
llvm-svn: 25046
2005-12-30 00:12:56 +00:00
Nate Begeman c2c8a6202f Remove a fixme
llvm-svn: 25045
2005-12-30 00:11:07 +00:00
Nate Begeman 164db3a7eb Make sure to pass the offset into the new node, so that we don't silently
drop it on the floor.

llvm-svn: 25044
2005-12-30 00:10:38 +00:00
Duraid Madina fb6a914ca7 purity++
llvm-svn: 25041
2005-12-29 05:59:19 +00:00
Andrew Lenharth 50d9caf6a4 let us get some do what I meant not what I said stuff checked in. You would think the alpha backend would be 64bit clean
llvm-svn: 25040
2005-12-29 01:06:12 +00:00
Andrew Lenharth 34e4782c95 Fix up immediate handling
llvm-svn: 25039
2005-12-29 00:50:08 +00:00
Duraid Madina 26b037e762 add these so I can be less naughty
llvm-svn: 25034
2005-12-28 06:29:02 +00:00
Duraid Madina e47d9d0e92 HB is *the* code janitor.
llvm-svn: 25031
2005-12-28 04:55:42 +00:00
Duraid Madina 7c3dcb6892 mixed-STL programs are big and nasty :(
llvm-svn: 25030
2005-12-28 02:44:35 +00:00
Duraid Madina 3f5aaf55b8 yet more C++ standards-compliance stuff.
llvm-svn: 25028
2005-12-27 10:40:34 +00:00
Duraid Madina 69ac08c683 nasty paste-o, calls passing more than 8 arguments along were having
args >8 put into the wrong place

llvm-svn: 25027
2005-12-27 10:17:03 +00:00
Andrew Lenharth 5bd1c2783b Restore some happiness to the JIT
llvm-svn: 25026
2005-12-27 06:25:50 +00:00
Andrew Lenharth 962dcbd572 Fix alpha regressions.
llvm-svn: 25025
2005-12-27 03:53:58 +00:00
Chris Lattner 8258489ca4 Fix a problem duraid pointed out to me compiling kc++ with -enable-x86-fastcc
llvm-svn: 25024
2005-12-27 03:02:18 +00:00
Duraid Madina c58523442a more C++ daintiness
llvm-svn: 25023
2005-12-26 14:31:26 +00:00
Duraid Madina 7859bd2ea4 I bet pinski knows why g++ accepts this stuff
llvm-svn: 25022
2005-12-26 14:23:22 +00:00
Duraid Madina 7a3ad6cae2 getting there...
llvm-svn: 25021
2005-12-26 13:48:44 +00:00
Duraid Madina 9d3058ccda dum de dum
llvm-svn: 25018
2005-12-26 10:24:15 +00:00
Evan Cheng 14c53b45f5 Added field noResults to Instruction.
Currently tblgen cannot tell which operands in the operand list are results so
it assumes the first one is a result. This is bad. Ideally we would fix this
by separating results from inputs, e.g. (res R32:$dst),
(ops R32:$src1, R32:$src2). But that's a more distruptive change. Adding
'let noResults = 1' is the workaround to tell tblgen that the instruction does
not produces a result. It works for now since tblgen does not support
instructions which produce multiple results.

llvm-svn: 25017
2005-12-26 09:11:45 +00:00
Duraid Madina c00eab5b03 more HP-UX cleanliness
llvm-svn: 25015
2005-12-26 08:35:06 +00:00
Duraid Madina b43eb8c75b HP aCC chokes on this, but it's not required anyway: according to
the bzip2 homepage, only ancient (gcc 2.7.x ?) versions of GCC
require this? It certainly isn't needed for the current bzip2
sources.

llvm-svn: 25013
2005-12-26 05:00:25 +00:00
Duraid Madina 36501f5eb0 MERRY CHRISTMAS EVERYONE!!! (what better way to spend christmas than
to try building LLVM on HP-UX! (the Right Way seems to be to tear out
the ancient STL that HP ship and use http://incubator.apache.org/stdcxx/ )

llvm-svn: 25012
2005-12-26 04:56:16 +00:00
Andrew Lenharth f520093eb3 add br pattern, unify JSR and BSR ISel instrs, and add BSR support for DAG
llvm-svn: 25011
2005-12-25 17:36:48 +00:00
Duraid Madina 6b240e55d1 unbreak calls, a few more tests should run. Tomorrow: bugpoint!
llvm-svn: 25010
2005-12-25 14:09:08 +00:00
Duraid Madina 06dcc199f0 we don't feed our call instructions extra operands
llvm-svn: 25009
2005-12-25 14:07:01 +00:00
Andrew Lenharth 0fce613eff All that just to lower div and rem
llvm-svn: 25008
2005-12-25 01:34:27 +00:00
Andrew Lenharth 30db2ec59f allow custom lowering to return null for legal results
llvm-svn: 25007
2005-12-25 01:07:37 +00:00
Andrew Lenharth 7259426d88 Support Custom lowering of a few more operations.
Alpha needs to custom lower *DIV and *REM

llvm-svn: 25006
2005-12-24 23:42:32 +00:00
Andrew Lenharth 0dc12c38e5 support targetexternalsym
llvm-svn: 25005
2005-12-24 23:36:59 +00:00
Evan Cheng 782b654e6f Let the helper functions know about X86::FR32RegClass and X86::FR64RegClass.
llvm-svn: 25004
2005-12-24 09:48:35 +00:00
Andrew Lenharth 5b18ed9e60 All addressing modes are now exposed. The only remaining relocated forms
are for function prologue.

TODO: move external symbols over to using RelLit.
    : have a pattern that matches constpool|globaladdr
    : have a pattern that matches (add x imm) -> x, imm or (...) -> ..., 0
llvm-svn: 25003
2005-12-24 08:29:32 +00:00
Andrew Lenharth b9aaea3564 Unify the patterns for loads and stores. Now offset addressing should be
supported.  This almost completes memory operations.

llvm-svn: 25002
2005-12-24 07:34:33 +00:00
Andrew Lenharth 4621488965 Let's see if we can break things.
Lower GOT relative addresses to Lo and HI.
Update both ISels to select them when they can.
Saves instructions here and there.

llvm-svn: 25001
2005-12-24 05:36:33 +00:00
Andrew Lenharth 636e1aed43 move loads and stores over. Smart addr selection comming
llvm-svn: 25000
2005-12-24 03:41:56 +00:00
Nate Begeman 9aea6e4691 Fix one of the things in the todo file, and get a bit closer to folding
constant offsets from statics into the address arithmetic.

llvm-svn: 24999
2005-12-24 01:00:15 +00:00
Evan Cheng 9ae486047e * Removed the use of FLAG. Now use hasFlagIn and hasFlagOut instead.
* Added a pseudo instruction (for each target) that represent "return void".
  This is a workaround for lack of optional flag operand (return void is not
  lowered so it does not have a flag operand.)

llvm-svn: 24997
2005-12-23 22:14:32 +00:00
Jim Laskey bdba3e2a46 Remove redundant debug locations.
llvm-svn: 24995
2005-12-23 20:08:28 +00:00
Chris Lattner c7037abc5b unbreak the build :-/
llvm-svn: 24992
2005-12-23 16:12:20 +00:00
Chris Lattner 4f52796f79 not a good idea
llvm-svn: 24991
2005-12-23 07:37:47 +00:00
Evan Cheng 5c59d49630 More X86 floating point patterns.
llvm-svn: 24990
2005-12-23 07:31:11 +00:00
Evan Cheng 8be8067b19 Operand 1 of TRUNCSTORE can be any of integer and floating point types.
llvm-svn: 24989
2005-12-23 07:30:30 +00:00
Evan Cheng 31d15fa093 Allow custom lowering of LOAD, EXTLOAD, ZEXTLOAD, STORE, and TRUNCSTORE. Not
currently used.

llvm-svn: 24988
2005-12-23 07:29:34 +00:00
Chris Lattner 55823ae03f fix something-o
llvm-svn: 24987
2005-12-23 07:08:39 +00:00
Chris Lattner 5427aab5f8 implement vaarg. Varargs now should work.
llvm-svn: 24986
2005-12-23 06:37:38 +00:00
Chris Lattner 5ee896aad9 implement vastart. The dag isel compiles this:
void test3(va_list Y);
void test2(int F, ...) {
  va_list X;
  va_start(X, F);
  test3(X);
}

into this:

test2:
        save -104, %o6, %o6
        st %i5, [%i6+88]
        st %i4, [%i6+84]
        st %i3, [%i6+80]
        st %i2, [%i6+76]
        st %i1, [%i6+72]
        add %i6, 72, %o0
        st %o0, [%i6+-4]
        call test3
        nop
        restore %g0, %g0, %g0
        retl
        nop

The simple isel emits:

test2:
        save -96, %o6, %o6
        st %i0, [%i6+68]
        st %i1, [%i6+72]
        st %i2, [%i6+76]
        st %i3, [%i6+80]
        st %i4, [%i6+84]
        st %i5, [%i6+88]
        or %g0, 1, %l0
        or %g0, 4, %l1
        umul %l0, %l1, %l0
        add %l0, 7, %l0
        and %l0, -8, %l0
        sub %o6, %l0, %o6
        add %o6, 96, %l0
        add %i6, 72, %l1
        st %l1, [%l0]
        ld [%l0], %o0
        call test3
        nop
        restore %g0, %g0, %g0
        retl
        nop

llvm-svn: 24985
2005-12-23 06:24:04 +00:00
Chris Lattner 6e6d5a1fa1 remove benchmark list, remove issues addressed by the dag-dag isel
llvm-svn: 24984
2005-12-23 06:09:30 +00:00
Chris Lattner 26943b9691 Simplify store(bitconv(x)) to store(x). This allows us to compile this:
void bar(double Y, double *X) {
  *X = Y;
}

to this:

bar:
        save -96, %o6, %o6
        st %i1, [%i2+4]
        st %i0, [%i2]
        restore %g0, %g0, %g0
        retl
        nop

instead of this:

bar:
        save -104, %o6, %o6
        st %i1, [%i6+-4]
        st %i0, [%i6+-8]
        ldd [%i6+-8], %f0
        std  %f0, [%i2]
        restore %g0, %g0, %g0
        retl
        nop

on sparcv8.

llvm-svn: 24983
2005-12-23 05:48:07 +00:00
Chris Lattner 54560f6887 fold (conv (load x)) -> (load (conv*)x).
This allows us to compile this:
void foo(double);
void bar(double *X) { foo(*X); }

To this:

bar:
        save -96, %o6, %o6
        ld [%i0+4], %o1
        ld [%i0], %o0
        call foo
        nop
        restore %g0, %g0, %g0
        retl
        nop

instead of this:

bar:
        save -104, %o6, %o6
        ldd [%i0], %f0
        std %f0, [%i6+-8]
        ld [%i6+-4], %o1
        ld [%i6+-8], %o0
        call foo
        nop
        restore %g0, %g0, %g0
        retl
        nop

on SparcV8.

llvm-svn: 24982
2005-12-23 05:44:41 +00:00
Chris Lattner efbbedbf4a Fold bitconv(bitconv(x)) -> x. We now compile this:
void foo(double);
void bar(double X) { foo(X); }

to this:

bar:
        save -96, %o6, %o6
        or %g0, %i0, %o0
        or %g0, %i1, %o1
        call foo
        nop
        restore %g0, %g0, %g0
        retl
        nop

instead of this:

bar:
        save -112, %o6, %o6
        st %i1, [%i6+-4]
        st %i0, [%i6+-8]
        ldd [%i6+-8], %f0
        std %f0, [%i6+-16]
        ld [%i6+-12], %o1
        ld [%i6+-16], %o0
        call foo
        nop
        restore %g0, %g0, %g0
        retl
        nop

on V8.

llvm-svn: 24981
2005-12-23 05:37:50 +00:00
Chris Lattner a187460552 constant fold bits_convert in getNode and in the dag combiner for fp<->int
conversions.  This allows V8 to compiles this:

void %test() {
        call float %test2( float 1.000000e+00, float 2.000000e+00, double 3.000000e+00, double* null )
        ret void
}

into:

test:
        save -96, %o6, %o6
        sethi 0, %o3
        sethi 1049088, %o2
        sethi 1048576, %o1
        sethi 1040384, %o0
        or %g0, %o3, %o4
        call test2
        nop
        restore %g0, %g0, %g0
        retl
        nop

instead of:

test:
        save -112, %o6, %o6
        sethi 0, %o4
        sethi 1049088, %l0
        st %o4, [%i6+-12]
        st %l0, [%i6+-16]
        ld [%i6+-12], %o3
        ld [%i6+-16], %o2
        sethi 1048576, %o1
        sethi 1040384, %o0
        call test2
        nop
        restore %g0, %g0, %g0
        retl
        nop

llvm-svn: 24980
2005-12-23 05:30:37 +00:00
Chris Lattner 30107e65c8 make sure bit_convert's are expanded
llvm-svn: 24979
2005-12-23 05:15:23 +00:00
Chris Lattner c46fc2482c make sure bit_converts are expanded
llvm-svn: 24978
2005-12-23 05:13:35 +00:00
Chris Lattner 5ce81edbf6 fix the int<->fp instructions, which apparently take a single float register
to represent the int part (because it's always 32-bits)

llvm-svn: 24976
2005-12-23 05:00:16 +00:00
Chris Lattner c9849274bd Use BIT_CONVERT to simplify this code
llvm-svn: 24975
2005-12-23 02:31:39 +00:00