Commit Graph

23390 Commits

Author SHA1 Message Date
Chris Lattner
e9efecbf47 Implement a FIXME, recusively reassociating
A*A*B + A*A*C   -->   A*(A*B+A*C)   -->   A*(A*(B+C))

This implements Reassociate/mul-factor3.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26757 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 16:04:29 +00:00
Chris Lattner
95f6553c49 new testcase from a FIXME in the code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26756 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 08:13:09 +00:00
Chris Lattner
895b392269 extract some code into a method, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26755 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 07:11:11 +00:00
Chris Lattner
ad5a3a0265 transformation implemented
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26754 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 06:57:34 +00:00
Chris Lattner
22a66c41f3 Promote shifts by a constant to multiplies so that we can reassociate
(x<<1)+(y<<1) -> (X+Y)<<1.  This implements
Transforms/Reassociate/shift-factor.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26753 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 06:55:18 +00:00
Chris Lattner
000c7c4c7b Test that we can reassociate (x<<1)+(y<<1) -> (X+Y)<<1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26752 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 06:54:32 +00:00
Reid Spencer
09a053a777 Allow a sequence of digits at the end of the directory name when trying to
determine the top directory. This allows the tool to find the correct top
directory when you have something like:

   /x/llvm
   /x/llvm2
   /x/llvm3

Previously the scripts would always find /x/llvm even if you were in the
llvm2 or llvm3 directory because the pattern didn't allow the digits at
the end of the path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26751 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 06:08:05 +00:00
Reid Spencer
b7b8317388 Change llvm.cs.uiuc.edu -> llvm.org
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26750 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 06:05:05 +00:00
Reid Spencer
767a25b878 Add a newline at the end to avoid gcc warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26749 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 05:59:52 +00:00
Reid Spencer
9dce2b3380 Convert llvm.cs.uiuc.edu -> llvm.org
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26748 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 05:54:52 +00:00
Reid Spencer
cd143fc4d0 Change docs for llvm.cs.uiuc.edu -> llvm.org
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26747 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 05:42:07 +00:00
Reid Spencer
05fe4b0256 Changes docs for llvm.cs.uiuc.edu -> llvm.org
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26746 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 05:39:39 +00:00
Jim Laskey
5a588a9636 1. Handle removal of all arguments for a morphed intrinsic.
2. Remove the declaration of llvm.dbg.declare.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26745 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 02:00:35 +00:00
Jim Laskey
ea6f8ce2a3 Remove the use of llvm.dbg.declare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26744 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 01:53:11 +00:00
Evan Cheng
9c543b2299 PPC LSR pass should use target lowering hooks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26743 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 23:56:51 +00:00
Evan Cheng
c4c6257c1a Added getTargetLowering() to TargetMachine. Refactored targets to support this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26742 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 23:20:37 +00:00
Evan Cheng
e617b085fe Update
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26741 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 23:19:10 +00:00
Evan Cheng
30b37b5f29 Add LSR hooks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26740 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 23:18:16 +00:00
Evan Cheng
a84b1c7c4e Added getTargetLowering() - returns DAG lowering info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26739 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 23:17:42 +00:00
Evan Cheng
d277f2c669 Added target lowering hooks which LSR consults to make more intelligent
transformation decisions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26738 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 23:14:23 +00:00
Chris Lattner
872421553e Handle builtins that directly correspond to GCC builtins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26737 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 23:09:05 +00:00
Chris Lattner
022f64fbbc emit a mapping from LLVM intrinsic -> GCC builtins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26736 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 23:08:44 +00:00
Chris Lattner
18faf5d9f7 Verify that packed type operands have the right size and base type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26735 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 22:38:57 +00:00
Chris Lattner
8ae7a3315f Add a first ppc altivec intrinsic. Add packed type support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26734 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 22:38:32 +00:00
Chris Lattner
1877ec9b02 For functions that use vector registers, save VRSAVE, mark used
registers, and update it on entry to each function, then restore it on exit.

This compiles:

void func(vfloat *a, vfloat *b, vfloat *c) {
        *a = *b * *c + *c;
}

to this:

_func:
        mfspr r2, 256
        oris r6, r2, 49152
        mtspr 256, r6
        lvx v0, 0, r5
        lvx v1, 0, r4
        vmaddfp v0, v1, v0, v0
        stvx v0, 0, r3
        mtspr 256, r2
        blr

GCC produces this (which has additional stack accesses):

_func:
        mfspr r0,256
        stw r0,-4(r1)
        oris r0,r0,0xc000
        mtspr 256,r0
        lvx v0,0,r5
        lvx v1,0,r4
        lwz r12,-4(r1)
        vmaddfp v0,v0,v1,v0
        stvx v0,0,r3
        mtspr 256,r12
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26733 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 21:52:10 +00:00
Evan Cheng
7abddda6cc Optimizing to calloc() to malloc() + memset() can be bad on some platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26732 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 21:22:43 +00:00
Chris Lattner
ac0f8f2929 make sure dead token factor nodes are removed by the dag combiner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26731 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 18:37:30 +00:00
Reid Spencer
a136429462 Bring makefile back into compliance with standard by using
$(Echo) instead of @echo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26730 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 17:57:31 +00:00
Jim Laskey
f4321a3a43 Handle the removal of the debug chain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26729 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 13:07:37 +00:00
Chris Lattner
2e8a77ff42 remove two implemented items
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26728 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 06:52:22 +00:00
Chris Lattner
947c28935d Fold X+Y -> X|Y when safe. This implements:
Regression/CodeGen/PowerPC/and_add.ll

a case that occurs with dynamic allocas of constant size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26727 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 06:51:27 +00:00
Chris Lattner
f4f5f6bca8 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26726 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 06:50:47 +00:00
Chris Lattner
b6b17ffbc6 I can't convince myself that this is safe, remove the recursive call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26725 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 06:42:16 +00:00
Chris Lattner
79dbea5ab4 add a couple of missing folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26724 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 06:26:26 +00:00
Chris Lattner
8f4191d619 For targets with FABS/FNEG support, lower copysign to an integer load,
a select and FABS/FNEG.

This speeds up a trivial (aka stupid) copysign benchmark I wrote from 6.73s
to 2.64s, woo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26723 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 06:08:38 +00:00
Chris Lattner
64ce964673 Fix a couple of bugs that broke the alpha tester build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26722 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 05:23:59 +00:00
Chris Lattner
3faad495bc Handle cracked instructions in dispatch group formation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26721 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 05:20:04 +00:00
Chris Lattner
fd97734f36 Mark instructions that are cracked by the PPC970 decoder as such.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26720 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 05:15:10 +00:00
Chris Lattner
88d211f823 Several big changes:
1. Use flags on the instructions in the .td file to indicate the PPC970 unit
   type instead of a table in the .cpp file.  Much cleaner.
2. Change the hazard recognizer to build d-groups according to the actual
   algorithm used, not my flawed understanding of it.
3. Model "must be in the first slot" and "must be the only instr in a group"
   accurately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26719 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-12 09:13:49 +00:00
Chris Lattner
fc3549ee8c Don't advance the hazard recognizer when there are no hazards and no instructions
to be emitted.

Don't add one to the latency of a completed instruction if the latency of the
op is 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26718 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-12 09:01:41 +00:00
Chris Lattner
b2215030d6 Chain operands aren't real uses: they don't require the full latency of the
predecessor to finish before they can start.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26717 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-12 03:52:09 +00:00
Chris Lattner
53fbf2a8e8 As a pending queue data structure to keep track of instructions whose
operands have all issued, but whose results are not yet available.  This
allows us to compile:

int G;
int test(int A, int B, int* P) {
   return (G+A)*(B+1);
}

to:

_test:
        lis r2, ha16(L_G$non_lazy_ptr)
        addi r4, r4, 1
        lwz r2, lo16(L_G$non_lazy_ptr)(r2)
        lwz r2, 0(r2)
        add r2, r2, r3
        mullw r3, r2, r4
        blr

instead of this, which has a stall between the lis/lwz:

_test:
        lis r2, ha16(L_G$non_lazy_ptr)
        lwz r2, lo16(L_G$non_lazy_ptr)(r2)
        addi r4, r4, 1
        lwz r2, 0(r2)
        add r2, r2, r3
        mullw r3, r2, r4
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26716 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-12 00:38:57 +00:00
Chris Lattner
aaf1582549 Mark llvm.stacksave as only reading memory, this fixes
Regression/Transforms/InstCombine/stacksaverestore.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26715 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-12 00:04:28 +00:00
Chris Lattner
8469031622 rename priorityqueue -> availablequeue. When a node is scheduled, remember
which cycle it lands on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26714 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-11 22:44:37 +00:00
Chris Lattner
c1c078c170 Make CurrCycle a local var instead of an instance var
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26713 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-11 22:34:41 +00:00
Chris Lattner
7d82b00048 Move some methods around so that BU specific code is together, TD specific code
is together, and direction independent code is together.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26712 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-11 22:28:35 +00:00
Chris Lattner
309cf8a713 merge preds/chainpreds -> preds set
merge succs/chainsuccs -> succs set

This has no functionality change, simplifies the code, and reduces the size
of sunits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26711 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-11 22:24:20 +00:00
Chris Lattner
9c2c38674a blr is a branch too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26710 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-11 21:49:49 +00:00
Chris Lattner
74cfb7d7b3 add an example
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26709 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-11 20:20:40 +00:00
Chris Lattner
c20995e070 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26708 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-11 20:17:08 +00:00