Commit Graph

16946 Commits

Author SHA1 Message Date
Chris Lattner 9de5890211 Add a new target-independent code generator flag.
llvm-svn: 19567
2005-01-15 06:00:32 +00:00
Chris Lattner e18a4c4c19 Add support for truncstore and *extload.
llvm-svn: 19566
2005-01-15 05:22:24 +00:00
Chris Lattner 1f2c9d82fa Add intitial support for promoting some operators.
llvm-svn: 19565
2005-01-15 05:21:40 +00:00
Chris Lattner ea2fa46f53 Improve output precision.
llvm-svn: 19564
2005-01-15 00:07:19 +00:00
Reid Spencer 730e7cb048 We don't distribute the operating system specific directories any more.
llvm-svn: 19563
2005-01-14 22:43:01 +00:00
Chris Lattner 3b8e719d1d Adjust to CopyFromReg changes, implement deletion of truncating/extending
stores/loads.

llvm-svn: 19562
2005-01-14 22:38:01 +00:00
Chris Lattner 720a62e8c7 Adjust to CopyFromREg changes.
llvm-svn: 19561
2005-01-14 22:37:41 +00:00
Chris Lattner 868e9d79d7 Change CopyFromReg to take and produce a chain node, allowing it to be used
with physregs that are not live across the entire block.

llvm-svn: 19560
2005-01-14 22:37:20 +00:00
Chris Lattner 39c6744c9f Start implementing truncating stores and extending loads.
llvm-svn: 19559
2005-01-14 22:08:15 +00:00
Chris Lattner 4bdb582200 Start adding some new operators, give IMPLICIT_DEF a chain operand.
llvm-svn: 19558
2005-01-14 22:07:46 +00:00
Chris Lattner d7bffad559 Fix Regression/CodeGen/PowerPC/2005-01-14-UndefLong.ll
llvm-svn: 19557
2005-01-14 20:22:02 +00:00
Chris Lattner 8025e8b9e6 New testcase, problem found by Rob.
llvm-svn: 19556
2005-01-14 20:21:51 +00:00
Chris Lattner c3ed31f837 Fix: Regression/CodeGen/PowerPC/2005-01-14-SetSelectCrash.ll
llvm-svn: 19555
2005-01-14 19:31:00 +00:00
Chris Lattner 57fb55d750 Testcase that crashes the PPC backend. Thanks to Rob for finding this.
llvm-svn: 19554
2005-01-14 19:30:42 +00:00
Chris Lattner 51726c47fe Fix some bugs in an xform added yesterday. This fixes Prolangs-C/allroots.
llvm-svn: 19553
2005-01-14 17:35:12 +00:00
Chris Lattner 7aa41cfa88 Fix a compile crash on spiff
llvm-svn: 19552
2005-01-14 17:17:59 +00:00
Reid Spencer b12e290f8a Allow the Echo and EchoCmd variables to be overridden.
llvm-svn: 19551
2005-01-14 16:33:36 +00:00
Reid Spencer 9dcfffd730 Fix the path from ../lib/Debug to ../Debug/lib per changes to Makefiles.
llvm-svn: 19550
2005-01-14 16:32:39 +00:00
Chris Lattner 0ad02bdd3d Improve compatibility with acc
llvm-svn: 19549
2005-01-14 15:54:24 +00:00
Chris Lattner d3af59bec2 Make this compatible with the HP/intel compiler. Fix by Duraid, thanks!
llvm-svn: 19548
2005-01-14 15:53:26 +00:00
Alkis Evlogimenos a938e629f6 Correctly update configure to configure the llvm-java project
llvm-svn: 19546
2005-01-14 07:52:28 +00:00
Jeff Cohen e246cdc946 Fix and improve win32 path validation.
llvm-svn: 19545
2005-01-14 04:09:39 +00:00
Reid Spencer cbeed3571a Make asctime_r work for HP/UX.
llvm-svn: 19544
2005-01-14 00:50:50 +00:00
Chris Lattner 144f6e3dee More testcases
llvm-svn: 19543
2005-01-14 00:26:25 +00:00
Chris Lattner 4fa89827e2 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.

llvm-svn: 19542
2005-01-14 00:20:05 +00:00
Chris Lattner d35d210ea0 Do not overrun iterators. This fixes a 176.gcc crash
llvm-svn: 19541
2005-01-13 23:26:48 +00:00
Chris Lattner 8ea1e8b982 Add a method
llvm-svn: 19540
2005-01-13 23:26:28 +00:00
Chris Lattner 7db6765530 new testcase
llvm-svn: 19539
2005-01-13 23:26:14 +00:00
Chris Lattner 7d131a4b9c Add a method
llvm-svn: 19538
2005-01-13 22:58:50 +00:00
Chris Lattner a04c904c4c 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

llvm-svn: 19537
2005-01-13 22:52:24 +00:00
Chris Lattner 81e8417614 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

llvm-svn: 19536
2005-01-13 22:25:21 +00:00
Chris Lattner e727af06c8 Add new ImplicitDef node, rename CopyRegSDNode class to RegSDNode.
llvm-svn: 19535
2005-01-13 20:50:02 +00:00
Chris Lattner 4cb9fa373b Fix some bugs in code I didn't mean to check in.
llvm-svn: 19534
2005-01-13 20:40:58 +00:00
Chris Lattner 0798af33a5 Fix a crash compiling 129.compress
llvm-svn: 19533
2005-01-13 20:14:25 +00:00
Chris Lattner 15bd19dd76 Codegen factor nodes more intelligently according to perceived register pressure.
llvm-svn: 19532
2005-01-13 19:56:00 +00:00
Chris Lattner 2451684678 Don't forget the existing root.
llvm-svn: 19531
2005-01-13 19:53:14 +00:00
Reid Spencer 74bc42304c Update the documentation about -enable-llcbeta vs. -enable-linscan
llvm-svn: 19530
2005-01-13 18:02:40 +00:00
Chris Lattner c251fb6441 Initial trivial (but stupid) codegen for this node.
llvm-svn: 19529
2005-01-13 18:01:36 +00:00
Chris Lattner 718b5c2f82 Codegen independent ops as being independent.
llvm-svn: 19528
2005-01-13 17:59:43 +00:00
Chris Lattner 05b4e37e85 Legalize new node, add assertion.
llvm-svn: 19527
2005-01-13 17:59:25 +00:00
Chris Lattner 4b1be0dfeb Print new node.
llvm-svn: 19526
2005-01-13 17:59:10 +00:00
Chris Lattner f510866785 Add a new node type, add comments.
llvm-svn: 19525
2005-01-13 17:58:35 +00:00
Reid Spencer 152733823e Turn on LOADABLE_MODULE so that profile.so can be loaded dynamically by
the JIT.

llvm-svn: 19524
2005-01-13 16:53:05 +00:00
Reid Spencer 9df352d469 Re-enable libprofile now that llvm-ar is working better.
llvm-svn: 19523
2005-01-13 16:51:19 +00:00
Chris Lattner 3676cd6fe2 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.

llvm-svn: 19522
2005-01-13 05:53:16 +00:00
Chris Lattner 4dfd2cfc0c 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

llvm-svn: 19519
2005-01-12 18:51:15 +00:00
Chris Lattner 7b1dae8032 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.

llvm-svn: 19518
2005-01-12 18:38:26 +00:00
Chris Lattner 40e7982c2c New method
llvm-svn: 19517
2005-01-12 18:37:47 +00:00
Chris Lattner 373e8f5607 New method.
llvm-svn: 19516
2005-01-12 18:37:33 +00:00
Chris Lattner 9864b08f94 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.

llvm-svn: 19515
2005-01-12 18:19:52 +00:00