oota-llvm.git
19 years agoFix the path from ../lib/Debug to ../Debug/lib per changes to Makefiles.
Reid Spencer [Fri, 14 Jan 2005 16:32:39 +0000 (16:32 +0000)]
Fix the path from ../lib/Debug to ../Debug/lib per changes to Makefiles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19550 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImprove compatibility with acc
Chris Lattner [Fri, 14 Jan 2005 15:54:24 +0000 (15:54 +0000)]
Improve compatibility with acc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19549 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake this compatible with the HP/intel compiler. Fix by Duraid, thanks!
Chris Lattner [Fri, 14 Jan 2005 15:53:26 +0000 (15:53 +0000)]
Make this compatible with the HP/intel compiler.  Fix by Duraid, thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19548 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoCorrectly update configure to configure the llvm-java project
Alkis Evlogimenos [Fri, 14 Jan 2005 07:52:28 +0000 (07:52 +0000)]
Correctly update configure to configure the llvm-java project

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19546 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix and improve win32 path validation.
Jeff Cohen [Fri, 14 Jan 2005 04:09:39 +0000 (04:09 +0000)]
Fix and improve win32 path validation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19545 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake asctime_r work for HP/UX.
Reid Spencer [Fri, 14 Jan 2005 00:50:50 +0000 (00:50 +0000)]
Make asctime_r work for HP/UX.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19544 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMore testcases
Chris Lattner [Fri, 14 Jan 2005 00:26:25 +0000 (00:26 +0000)]
More testcases

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19543 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoif two gep comparisons only differ by one index, compare that index directly.
Chris Lattner [Fri, 14 Jan 2005 00:20:05 +0000 (00:20 +0000)]
if two gep comparisons only differ by one index, compare that index directly.
This allows us to better optimize begin() -> end() comparisons in common cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19542 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoDo not overrun iterators. This fixes a 176.gcc crash
Chris Lattner [Thu, 13 Jan 2005 23:26:48 +0000 (23:26 +0000)]
Do not overrun iterators.  This fixes a 176.gcc crash

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19541 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a method
Chris Lattner [Thu, 13 Jan 2005 23:26:28 +0000 (23:26 +0000)]
Add a method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19540 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew testcase
Chris Lattner [Thu, 13 Jan 2005 23:26:14 +0000 (23:26 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19539 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a method
Chris Lattner [Thu, 13 Jan 2005 22:58:50 +0000 (22:58 +0000)]
Add a method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19538 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTurn select C, (X+Y), (X-Y) --> (X+(select C, Y, (-Y))). This occurs in
Chris Lattner [Thu, 13 Jan 2005 22:52:24 +0000 (22:52 +0000)]
Turn select C, (X+Y), (X-Y) --> (X+(select C, Y, (-Y))).  This occurs in
the 'sim' program and probably elsewhere.  In sim, it comes up for cases
like this:

#define round(x) ((x)>0.0 ? (x)+0.5 : (x)-0.5)
double G;
void T(double X) { G = round(X); }

(it uses the round macro a lot).  This changes the LLVM code from:

        %tmp.1 = setgt double %X, 0.000000e+00          ; <bool> [#uses=1]
        %tmp.4 = add double %X, 5.000000e-01            ; <double> [#uses=1]
        %tmp.6 = sub double %X, 5.000000e-01            ; <double> [#uses=1]
        %mem_tmp.0 = select bool %tmp.1, double %tmp.4, double %tmp.6
        store double %mem_tmp.0, double* %G

to:

        %tmp.1 = setgt double %X, 0.000000e+00          ; <bool> [#uses=1]
        %mem_tmp.0.p = select bool %tmp.1, double 5.000000e-01, double -5.000000e-01
        %mem_tmp.0 = add double %mem_tmp.0.p, %X
        store double %mem_tmp.0, double* %G
        ret void

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19537 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement an optimization for == and != comparisons like this:
Chris Lattner [Thu, 13 Jan 2005 22:25:21 +0000 (22:25 +0000)]
Implement an optimization for == and != comparisons like this:

_Bool test2(int X, int Y) {
  return &arr[X][Y] == arr;
}

instead of generating this:

bool %test2(int %X, int %Y) {
        %tmp.3.idx = mul int %X, 160            ; <int> [#uses=1]
        %tmp.3.idx1 = shl int %Y, ubyte 2               ; <int> [#uses=1]
        %tmp.3.offs2 = sub int 0, %tmp.3.idx            ; <int> [#uses=1]
        %tmp.7 = seteq int %tmp.3.idx1, %tmp.3.offs2            ; <bool> [#uses=1]
        ret bool %tmp.7
}

generate this:

bool %test2(int %X, int %Y) {
        seteq int %X, 0         ; <bool>:0 [#uses=1]
        seteq int %Y, 0         ; <bool>:1 [#uses=1]
        %tmp.7 = and bool %0, %1                ; <bool> [#uses=1]
        ret bool %tmp.7
}

This idiom occurs in C++ programs when iterating from begin() to end(),
in a vector or array.  For example, we now compile this:

void test(int X, int Y) {
  for (int *i = arr; i != arr+100; ++i)
    foo(*i);
}

to this:

no_exit:                ; preds = %entry, %no_exit
...
        %exitcond = seteq uint %indvar.next, 100                ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit

instead of this:

no_exit:                ; preds = %entry, %no_exit
...
        %inc5 = getelementptr [100 x [40 x int]]* %arr, int 0, int 0, int %inc.rec              ; <int*> [#uses=1]
        %tmp.8 = seteq int* %inc5, getelementptr ([100 x [40 x int]]* %arr, int 0, int 100, int 0)              ; <bool> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.8, label %return, label %no_exit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19536 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd new ImplicitDef node, rename CopyRegSDNode class to RegSDNode.
Chris Lattner [Thu, 13 Jan 2005 20:50:02 +0000 (20:50 +0000)]
Add new ImplicitDef node, rename CopyRegSDNode class to RegSDNode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19535 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix some bugs in code I didn't mean to check in.
Chris Lattner [Thu, 13 Jan 2005 20:40:58 +0000 (20:40 +0000)]
Fix some bugs in code I didn't mean to check in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19534 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a crash compiling 129.compress
Chris Lattner [Thu, 13 Jan 2005 20:14:25 +0000 (20:14 +0000)]
Fix a crash compiling 129.compress

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19533 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoCodegen factor nodes more intelligently according to perceived register pressure.
Chris Lattner [Thu, 13 Jan 2005 19:56:00 +0000 (19:56 +0000)]
Codegen factor nodes more intelligently according to perceived register pressure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19532 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoDon't forget the existing root.
Chris Lattner [Thu, 13 Jan 2005 19:53:14 +0000 (19:53 +0000)]
Don't forget the existing root.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19531 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoUpdate the documentation about -enable-llcbeta vs. -enable-linscan
Reid Spencer [Thu, 13 Jan 2005 18:02:40 +0000 (18:02 +0000)]
Update the documentation about -enable-llcbeta vs. -enable-linscan

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19530 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoInitial trivial (but stupid) codegen for this node.
Chris Lattner [Thu, 13 Jan 2005 18:01:36 +0000 (18:01 +0000)]
Initial trivial (but stupid) codegen for this node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19529 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoCodegen independent ops as being independent.
Chris Lattner [Thu, 13 Jan 2005 17:59:43 +0000 (17:59 +0000)]
Codegen independent ops as being independent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19528 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoLegalize new node, add assertion.
Chris Lattner [Thu, 13 Jan 2005 17:59:25 +0000 (17:59 +0000)]
Legalize new node, add assertion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19527 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoPrint new node.
Chris Lattner [Thu, 13 Jan 2005 17:59:10 +0000 (17:59 +0000)]
Print new node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19526 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a new node type, add comments.
Chris Lattner [Thu, 13 Jan 2005 17:58:35 +0000 (17:58 +0000)]
Add a new node type, add comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19525 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTurn on LOADABLE_MODULE so that profile.so can be loaded dynamically by
Reid Spencer [Thu, 13 Jan 2005 16:53:05 +0000 (16:53 +0000)]
Turn on LOADABLE_MODULE so that profile.so can be loaded dynamically by
the JIT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19524 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRe-enable libprofile now that llvm-ar is working better.
Reid Spencer [Thu, 13 Jan 2005 16:51:19 +0000 (16:51 +0000)]
Re-enable libprofile now that llvm-ar is working better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19523 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd some really pedantic assertions to the load folding code. Fix a bunch
Chris Lattner [Thu, 13 Jan 2005 05:53:16 +0000 (05:53 +0000)]
Add some really pedantic assertions to the load folding code.  Fix a bunch
of cases where we accidentally emitted a load folded once and unfolded
elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19522 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoDo not fold (zero_ext (sign_ext V)) -> (sign_ext V), they are not the same.
Chris Lattner [Wed, 12 Jan 2005 18:51:15 +0000 (18:51 +0000)]
Do not fold (zero_ext (sign_ext V)) -> (sign_ext V), they are not the same.

This fixes llvm-test/SingleSource/Regression/C/casts.c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19519 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoWe can only fold a load into an op if there is exactly one use of the value.
Chris Lattner [Wed, 12 Jan 2005 18:38:26 +0000 (18:38 +0000)]
We can only fold a load into an op if there is exactly one use of the value.
Checking to see if the load has two uses is not equivalent, as the chain
value may have zero uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19518 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoNew method
Chris Lattner [Wed, 12 Jan 2005 18:37:47 +0000 (18:37 +0000)]
New method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19517 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoNew method.
Chris Lattner [Wed, 12 Jan 2005 18:37:33 +0000 (18:37 +0000)]
New method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19516 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix sign extend to long. When coming from sbyte, we used to generate:
Chris Lattner [Wed, 12 Jan 2005 18:19:52 +0000 (18:19 +0000)]
Fix sign extend to long.  When coming from sbyte, we used to generate:

        movsbl 4(%esp), %eax
        movl %eax, %edx
        sarl $7, %edx

Now we generate:

        movsbl 4(%esp), %eax
        movl %eax, %edx
        sarl $31, %edx

Which is right.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19515 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoUpdate comments to indicate CopyFrom/ToReg take physregs as well as vregs.
Chris Lattner [Wed, 12 Jan 2005 18:11:36 +0000 (18:11 +0000)]
Update comments to indicate CopyFrom/ToReg take physregs as well as vregs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19514 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTry both ways to fold an add together. This allows us to generate this code
Chris Lattner [Wed, 12 Jan 2005 18:08:53 +0000 (18:08 +0000)]
Try both ways to fold an add together.  This allows us to generate this code

        imul %EAX, %EAX, 400
        add %ECX, %EAX
        add %ESI, DWORD PTR [%ECX + 4*%EDX]
        inc %EDX
        cmp %EDX, 100

instead of this:

        imul %EAX, %EAX, 400
        add %ECX, %EAX
        mov %EAX, %EDX
        shl %EAX, 2
        add %ECX, %EAX
        add %ESI, DWORD PTR [%ECX]
        inc %EDX
        cmp %EDX, 100

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19513 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoShut up warnings with GCC 3.4.3 about uninitialized variables.
Reid Spencer [Wed, 12 Jan 2005 14:53:45 +0000 (14:53 +0000)]
Shut up warnings with GCC 3.4.3 about uninitialized variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19512 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a major miscompilation where we were overwriting the scale reg.
Chris Lattner [Wed, 12 Jan 2005 07:33:20 +0000 (07:33 +0000)]
Fix a major miscompilation where we were overwriting the scale reg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19511 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoDo not use the type of the RHS constant to determine the type of the operation.
Chris Lattner [Wed, 12 Jan 2005 05:22:07 +0000 (05:22 +0000)]
Do not use the type of the RHS constant to determine the type of the operation.
This fails for shifts because the constant is always 8 bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19508 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoDo not lose the offset from teh global when peephole optimizing instructions.
Chris Lattner [Wed, 12 Jan 2005 05:17:28 +0000 (05:17 +0000)]
Do not lose the offset from teh global when peephole optimizing instructions.
This fixes FreeBench/pcompress

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19507 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoSilence VC++ warnings.
Chris Lattner [Wed, 12 Jan 2005 04:51:37 +0000 (04:51 +0000)]
Silence VC++ warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19506 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd new file to Visual Studio CodeGen project
Jeff Cohen [Wed, 12 Jan 2005 04:32:42 +0000 (04:32 +0000)]
Add new file to Visual Studio CodeGen project

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19505 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix C++ more compilatiom errors
Jeff Cohen [Wed, 12 Jan 2005 04:29:05 +0000 (04:29 +0000)]
Fix C++ more compilatiom errors

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19504 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a compile error with VC++, which things that static const arrays need
Chris Lattner [Wed, 12 Jan 2005 04:23:22 +0000 (04:23 +0000)]
Fix a compile error with VC++, which things that static const arrays need
to be dynamically initialized. :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19503 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a bug that caused us to crash on povray. We weren't emitting an FP_REG_KILL...
Chris Lattner [Wed, 12 Jan 2005 04:21:28 +0000 (04:21 +0000)]
Fix a bug that caused us to crash on povray.  We weren't emitting an FP_REG_KILL into a block that had a successor with a FP PHI node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19502 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoPrint a load of a null pointer (in intel mode) like this:
Chris Lattner [Wed, 12 Jan 2005 04:07:11 +0000 (04:07 +0000)]
Print a load of a null pointer (in intel mode) like this:

        mov %AX, WORD PTR [0]

instead of like this:

        mov %AX, WORD PTR []

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19501 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoPrint a load of a null pointer like this:
Chris Lattner [Wed, 12 Jan 2005 04:05:19 +0000 (04:05 +0000)]
Print a load of a null pointer like this:

        movw 0, %ax

instead of like this:

        movw , %ax

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19500 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a crash compiling povray on UINT_TO_FP from i16.
Chris Lattner [Wed, 12 Jan 2005 04:00:00 +0000 (04:00 +0000)]
Fix a crash compiling povray on UINT_TO_FP from i16.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19499 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd an option to view the selection dags as they are generated.
Chris Lattner [Wed, 12 Jan 2005 03:41:21 +0000 (03:41 +0000)]
Add an option to view the selection dags as they are generated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19498 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoUse and print out BuildStatus, we don't always have build errors.
Misha Brukman [Wed, 12 Jan 2005 03:31:38 +0000 (03:31 +0000)]
Use and print out BuildStatus, we don't always have build errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19497 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoThere are no [mem] op= reg instructions for FP, so remove their entries.
Chris Lattner [Wed, 12 Jan 2005 03:16:09 +0000 (03:16 +0000)]
There are no [mem] op= reg instructions for FP, so remove their entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19496 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a bug where we didn't insert FP_REG_KILL instructions into MBB's that
Chris Lattner [Wed, 12 Jan 2005 02:57:10 +0000 (02:57 +0000)]
Fix a bug where we didn't insert FP_REG_KILL instructions into MBB's that
contain FP PHI nodes but no other FP defining instructions.  This fixes
183.equake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19495 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFold TRUNCATE (LOAD P) into a smaller load from P.
Chris Lattner [Wed, 12 Jan 2005 02:19:06 +0000 (02:19 +0000)]
Fold TRUNCATE (LOAD P) into a smaller load from P.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19494 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoBe more careful about order of arg evalution for CopyToReg nodes. This shrinks
Chris Lattner [Wed, 12 Jan 2005 02:02:48 +0000 (02:02 +0000)]
Be more careful about order of arg evalution for CopyToReg nodes.  This shrinks
256.bzip2 from 7142 to 7103 lines of .s file.

Second, add initial support for folding loads into compares, though this code
is dynamically dead for now. :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19493 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFold some more [mem] op= val operators. This allows us to things like this
Chris Lattner [Wed, 12 Jan 2005 01:28:00 +0000 (01:28 +0000)]
Fold some more [mem] op= val  operators.  This allows us to things like this
several times in 256.bzip2:

        mov %EAX, DWORD PTR [%ESP + 204]
-       mov %EAX, DWORD PTR [%EAX]
-       or %EAX, 2097152
-       mov %ECX, DWORD PTR [%ESP + 204]
-       mov DWORD PTR [%ECX], %EAX
+       or DWORD PTR [%EAX], 2097152

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19492 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFold loads into sign/zero extends. instead of:
Chris Lattner [Tue, 11 Jan 2005 23:33:00 +0000 (23:33 +0000)]
Fold loads into sign/zero extends.  instead of:

  mov %AL, BYTE PTR [%EDX + l18_length_code]
  movzx %EAX, %AL

Emit:

  movzx %EAX, BYTE PTR [%EDX + l18_length_code]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19489 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoComment out debug code :)
Chris Lattner [Tue, 11 Jan 2005 23:21:30 +0000 (23:21 +0000)]
Comment out debug code :)

Select [mem] += Val operations.  For constants, we used to get:

  mov %ECX, -32768
  add %ECX, DWORD PTR [l4_match_start]
  mov DWORD PTR [l4_match_start], %ECX

Now we get:

  add DWORD PTR [l4_match_start], -32768

For other values we used to get:

  mov %EBP, %EDI   ;; because the add destroys the value
  add %EBP, DWORD PTR [l4_input_len]
  mov DWORD PTR [l4_input_len], %EBP

now we get:

  add DWORD PTR [l4_input_len], %EDI

Both of these use less registers than the alternative, are faster and smaller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19488 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoHandle the global address case here, not just the offset case.
Chris Lattner [Tue, 11 Jan 2005 22:58:43 +0000 (22:58 +0000)]
Handle the global address case here, not just the offset case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19487 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTreat int constants as not requiring a register, since they are almost always
Chris Lattner [Tue, 11 Jan 2005 22:29:12 +0000 (22:29 +0000)]
Treat int constants as not requiring a register, since they are almost always
folded into an instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19486 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoPrint the value types in the nodes of the graph
Chris Lattner [Tue, 11 Jan 2005 22:21:04 +0000 (22:21 +0000)]
Print the value types in the nodes of the graph

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19485 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd an assertion, avoid creating copyfromreg/copytoreg pairs that are the
Chris Lattner [Tue, 11 Jan 2005 22:03:46 +0000 (22:03 +0000)]
add an assertion, avoid creating copyfromreg/copytoreg pairs that are the
same for PHI nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19484 91177308-0d34-0410-b5e6-96231b3b80d8

19 years ago* Factor a bunch of binary operator cases into shared code.
Chris Lattner [Tue, 11 Jan 2005 21:19:59 +0000 (21:19 +0000)]
* Factor a bunch of binary operator cases into shared code.
* Fold loads into Add, sub, and, or, xor and mul when possible.
* Codegen shl X, 1 as add X, X

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19483 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoClear the whole array, always.
Chris Lattner [Tue, 11 Jan 2005 20:25:26 +0000 (20:25 +0000)]
Clear the whole array, always.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19482 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoNo need to repeat the word `build' since it's under `Build status'
Misha Brukman [Tue, 11 Jan 2005 19:51:24 +0000 (19:51 +0000)]
No need to repeat the word `build' since it's under `Build status'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19481 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFold multiplies by 3,5,9 into addressing modes when possible.
Chris Lattner [Tue, 11 Jan 2005 19:37:02 +0000 (19:37 +0000)]
Fold multiplies by 3,5,9 into addressing modes when possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19480 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoWe don't always have build errors, so call it `status', not `error'
Misha Brukman [Tue, 11 Jan 2005 18:27:16 +0000 (18:27 +0000)]
We don't always have build errors, so call it `status', not `error'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19479 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoSquelch optimized warning.
Chris Lattner [Tue, 11 Jan 2005 17:46:49 +0000 (17:46 +0000)]
Squelch optimized warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19475 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix the documentation for executeAndWait so the argument comments are
Reid Spencer [Tue, 11 Jan 2005 06:37:27 +0000 (06:37 +0000)]
Fix the documentation for executeAndWait so the argument comments are
actually attributed to the arguments by doxygen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19473 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoInstead of generating stuff like this:
Chris Lattner [Tue, 11 Jan 2005 06:36:20 +0000 (06:36 +0000)]
Instead of generating stuff like this:

        mov %ECX, %EAX
        add %ECX, 32768
        mov %SI, WORD PTR [2*%ECX + l13_prev]

Generate this:

        mov %SI, WORD PTR [2*%ECX + l13_prev + 65536]

This occurs when you have a GEP instruction where an index is
"something + imm".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19472 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake the construction of doxygen documentation a repeatable process
Reid Spencer [Tue, 11 Jan 2005 06:26:27 +0000 (06:26 +0000)]
Make the construction of doxygen documentation a repeatable process

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19469 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement MEMCPY natively in terms of rep movs*
Chris Lattner [Tue, 11 Jan 2005 06:19:26 +0000 (06:19 +0000)]
Implement MEMCPY natively in terms of rep movs*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19468 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement memset -> rep stos*
Chris Lattner [Tue, 11 Jan 2005 06:14:36 +0000 (06:14 +0000)]
Implement memset -> rep stos*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19467 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAnnounce that we don't support mem ops yet.
Chris Lattner [Tue, 11 Jan 2005 05:57:36 +0000 (05:57 +0000)]
Announce that we don't support mem ops yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19466 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTeach legalize to lower MEMSET/MEMCPY/MEMMOVE operations if the target
Chris Lattner [Tue, 11 Jan 2005 05:57:22 +0000 (05:57 +0000)]
Teach legalize to lower MEMSET/MEMCPY/MEMMOVE operations if the target
does not support them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19465 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoPrint new operations.
Chris Lattner [Tue, 11 Jan 2005 05:57:01 +0000 (05:57 +0000)]
Print new operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19464 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTurn memset/memcpy/memmove into the corresponding operations.
Chris Lattner [Tue, 11 Jan 2005 05:56:49 +0000 (05:56 +0000)]
Turn memset/memcpy/memmove into the corresponding operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19463 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd MEMSET/MEMCPY/MEMMOVE operations. Fix a really bad bug in the vector
Chris Lattner [Tue, 11 Jan 2005 05:56:17 +0000 (05:56 +0000)]
Add MEMSET/MEMCPY/MEMMOVE operations.  Fix a really bad bug in the vector
SDNode ctor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19462 91177308-0d34-0410-b5e6-96231b3b80d8

19 years ago* Add the use of LOADABLE_MODULE=1 in the makefile example
Reid Spencer [Tue, 11 Jan 2005 05:16:23 +0000 (05:16 +0000)]
* Add the use of LOADABLE_MODULE=1 in the makefile example
* Change the names of the resulting module to Hello instead of libHello
* Change lib/Debug -> Debug/lib per new makefile implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19459 91177308-0d34-0410-b5e6-96231b3b80d8

19 years ago* Describe the LOADABLE_MODULE feature
Reid Spencer [Tue, 11 Jan 2005 05:12:54 +0000 (05:12 +0000)]
* Describe the LOADABLE_MODULE feature
* Get rid of non-compliant <font> elements (how did that get in there?)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19458 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTeach the address selector to make 'reg+reg' addressing modes.
Chris Lattner [Tue, 11 Jan 2005 04:40:19 +0000 (04:40 +0000)]
Teach the address selector to make 'reg+reg' addressing modes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19457 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd the LOADABLE_MODULE=1 directive to indicate that this shared library is
Reid Spencer [Tue, 11 Jan 2005 04:33:32 +0000 (04:33 +0000)]
Add the LOADABLE_MODULE=1 directive to indicate that this shared library is
intended to be a dlopenable module and not a "plain" shared library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19456 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEmit NOT instructions.
Chris Lattner [Tue, 11 Jan 2005 04:31:30 +0000 (04:31 +0000)]
Emit NOT instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19455 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement the LOADABLE_MODULE option when building a shared library. This
Reid Spencer [Tue, 11 Jan 2005 04:31:07 +0000 (04:31 +0000)]
Implement the LOADABLE_MODULE option when building a shared library. This
passes the -module option on the libtool command line to ensure that the
shared library being built can be dlopened and dlsym can work on that
module. LOADABLE_MODULE should be sent only in conjunction with the
SHARED_LIBRARY directive. It should generally be used for any module that
is intended to be the target of an LLVM -load option. Note that loadable
modules will not have the lib prefix but otherwise look like shared
libraries. This is per the libtool recommendations and prevents these
special shared libraries from being linked in via -l option to the linker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19454 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoshift X, 0 -> X
Chris Lattner [Tue, 11 Jan 2005 04:25:13 +0000 (04:25 +0000)]
shift X, 0 -> X

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19453 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a bug emitting branches that broke a lot of programs.
Chris Lattner [Tue, 11 Jan 2005 04:06:27 +0000 (04:06 +0000)]
Fix a bug emitting branches that broke a lot of programs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19452 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoBe more careful where we set ContainsFPCode. We were missing a set in the
Chris Lattner [Tue, 11 Jan 2005 03:50:45 +0000 (03:50 +0000)]
Be more careful where we set ContainsFPCode.  We were missing a set in the
int -> FP casting code.  Note that we don't have to set it for FP operations
that take FP values as operands: whatever produces the FP value will set the
flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19451 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a major bug in setcc/cmov folding, where we accidentally
Chris Lattner [Tue, 11 Jan 2005 03:37:59 +0000 (03:37 +0000)]
Fix a major bug in setcc/cmov folding, where we accidentally
inverted the sense of the comparison.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19450 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTake register pressure into account when we have to decide whether to
Chris Lattner [Tue, 11 Jan 2005 03:11:44 +0000 (03:11 +0000)]
Take register pressure into account when we have to decide whether to
evaluate the LHS or the RHS of an operation first.  This causes good things
to happen.  For example, instead of compiling a loop to this:

.LBBstrength_result7_1: # loopentry
        movl 16(%esp), %edi
        movl (%edi), %edi             ;;; LOAD
        movl (%ecx), %ebx
        movl $2, (%eax,%ebx,4)
        movl (%edx), %ebx
        movl %esi, %ebp
        addl $21, %ebp
        addl $42, %esi
        cmpl $0, %edi                 ;;; USE
        cmovne %esi, %ebp
        cmpl %ebp, %ebx
        movl %ebp, %esi
        jg .LBBstrength_result7_1

We now compile it to this:

.LBBstrength_result7_1: # loopentry
        movl %edi, %ebx
        addl $42, %ebx
        addl $21, %edi
        movl (%ecx), %ebp              ;; LOAD
        cmpl $0, %ebp                  ;; USE
        cmovne %ebx, %edi
        movl (%edx), %ebx
        movl $2, (%eax,%ebx,4)
        movl (%esi), %ebx
        cmpl %edi, %ebx
        jg .LBBstrength_result7_1

Which reduces register pressure enough (in this case) to avoid spilling in the
loop.

As another example, consider the CodeGen/X86/regpressure.ll testcase.  We
used to generate this code for both cases:

regpressure1:
        subl $32, %esp
        movl %esi, 12(%esp)
        movl %edi, 8(%esp)
        movl %ebx, 4(%esp)
        movl %ebp, (%esp)
        movl 36(%esp), %ecx
        movl (%ecx), %eax
        movl 4(%ecx), %edx
        movl %edx, 24(%esp)
        movl 8(%ecx), %edx
        movl %edx, 16(%esp)
        movl 12(%ecx), %edx
        movl 16(%ecx), %esi
        movl 20(%ecx), %edi
        movl 24(%ecx), %ebx
        movl %ebx, 28(%esp)
        movl 28(%ecx), %ebx
        movl 32(%ecx), %ebp
        movl %ebp, 20(%esp)
        movl 36(%ecx), %ecx
        imull 24(%esp), %eax
        imull 16(%esp), %eax
        imull %edx, %eax
        imull %esi, %eax
        imull %edi, %eax
        imull 28(%esp), %eax
        imull %ebx, %eax
        imull 20(%esp), %eax
        imull %ecx, %eax
        movl (%esp), %ebp
        movl 4(%esp), %ebx
        movl 8(%esp), %edi
        movl 12(%esp), %esi
        addl $32, %esp
        ret

This code is basically trying to do all of the loads first, then execute all
of the multiplies.  Because we run out of registers, lots of spill code happens.
We now generate this code for both cases:

regpressure1:
        movl 4(%esp), %ecx
        movl (%ecx), %eax
        movl 4(%ecx), %edx
        imull %edx, %eax
        movl 8(%ecx), %edx
        imull %edx, %eax
        movl 12(%ecx), %edx
        imull %edx, %eax
        movl 16(%ecx), %edx
        imull %edx, %eax
        movl 20(%ecx), %edx
        imull %edx, %eax
        movl 24(%ecx), %edx
        imull %edx, %eax
        movl 28(%ecx), %edx
        imull %edx, %eax
        movl 32(%ecx), %edx
        imull %edx, %eax
        movl 36(%ecx), %ecx
        imull %ecx, %eax
        ret

which is much nicer (when we fold loads into the muls it will be even better).
The old instruction selector used to produce the good code for regpressure1
but not for regpressure2, as it depended on the order of operations in the
LLVM code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19449 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoThe pattern isel is aggressively codegen'ing all of the loads in these
Chris Lattner [Tue, 11 Jan 2005 03:05:03 +0000 (03:05 +0000)]
The pattern isel is aggressively codegen'ing all of the loads in these
functions together at the start of the basic block, causing massive spillage.
The old isel codegened the loads wherever they happened to land, so it
generated good code for the first case, but bad code for the second.

We really want the pattern isel to generate (the same) good code for both.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19448 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoPrint SelectionDAGs bottom up, include extra info in the node labels
Chris Lattner [Tue, 11 Jan 2005 00:34:33 +0000 (00:34 +0000)]
Print SelectionDAGs bottom up, include extra info in the node labels

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19447 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for bottom-up graphs.
Chris Lattner [Tue, 11 Jan 2005 00:24:59 +0000 (00:24 +0000)]
Add support for bottom-up graphs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19446 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a marker for the graph root.
Chris Lattner [Mon, 10 Jan 2005 23:52:04 +0000 (23:52 +0000)]
Add a marker for the graph root.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19445 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoPut the operation name in each node, put the function name on the graph.
Chris Lattner [Mon, 10 Jan 2005 23:26:00 +0000 (23:26 +0000)]
Put the operation name in each node, put the function name on the graph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19444 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoSplit out SDNode::getOperationName into its own method.
Chris Lattner [Mon, 10 Jan 2005 23:25:25 +0000 (23:25 +0000)]
Split out SDNode::getOperationName into its own method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19443 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a helper method.
Chris Lattner [Mon, 10 Jan 2005 23:25:04 +0000 (23:25 +0000)]
Add a helper method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19442 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement initial selectiondag printing support. This gets us a nice
Chris Lattner [Mon, 10 Jan 2005 23:08:40 +0000 (23:08 +0000)]
Implement initial selectiondag printing support.  This gets us a nice
graph with no labels! :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19441 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for graph operations, and add a viewGraph method to SelectionDAG.
Chris Lattner [Mon, 10 Jan 2005 23:05:53 +0000 (23:05 +0000)]
Add support for graph operations, and add a viewGraph method to SelectionDAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19440 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a helper method
Chris Lattner [Mon, 10 Jan 2005 23:05:07 +0000 (23:05 +0000)]
Add a helper method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19439 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFold setcc instructions into selects.
Chris Lattner [Mon, 10 Jan 2005 22:10:13 +0000 (22:10 +0000)]
Fold setcc instructions into selects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19438 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd conditional moves for the parity flag.
Chris Lattner [Mon, 10 Jan 2005 22:09:33 +0000 (22:09 +0000)]
Add conditional moves for the parity flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19437 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoLower to the correct functions. This fixes FreeBench/fourinarow
Chris Lattner [Mon, 10 Jan 2005 21:02:37 +0000 (21:02 +0000)]
Lower to the correct functions.  This fixes FreeBench/fourinarow

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19436 91177308-0d34-0410-b5e6-96231b3b80d8