Commit Graph

2419 Commits

Author SHA1 Message Date
Chris Lattner
54a30b9639 TargetData doesn't know the alignment of vectors :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26884 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-20 01:51:46 +00:00
Chris Lattner
fb194b9e73 Add very basic support for VECTOR_SHUFFLE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26880 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19 23:56:04 +00:00
Chris Lattner
4d3abee618 Allow SCALAR_TO_VECTOR to be custom lowered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26867 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19 06:47:21 +00:00
Chris Lattner
ce87215131 Add SCALAR_TO_VECTOR support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26866 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19 06:31:19 +00:00
Chris Lattner
74881908fe Don't bother storing undef elements of BUILD_VECTOR's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26858 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19 05:46:04 +00:00
Chris Lattner
5fcd0350be Implement expand of BUILD_VECTOR containing variable elements.
This implements CodeGen/Generic/vector.ll:test_variable_buildvector


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26852 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19 04:18:56 +00:00
Chris Lattner
ca24244234 fold insertelement(buildvector) -> buildvector if the inserted element # is
a constant.  This implements test_constant_insert in CodeGen/Generic/vector.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26851 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19 01:27:56 +00:00
Chris Lattner
2332b9f16f implement basic support for INSERT_VECTOR_ELT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26849 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19 01:17:20 +00:00
Chris Lattner
b2827b0901 Rename ConstantVec -> BUILD_VECTOR and VConstant -> VBUILD_VECTOR. Allow*BUILD_VECTOR to take variable inputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26847 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19 00:52:58 +00:00
Chris Lattner
23d564c11f implement vector.ll:test_undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26845 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19 00:20:20 +00:00
Chris Lattner
4794a6b6a0 Fix the remaining bugs in the vector expansion rework I commited yesterday.
This fixes CodeGen/Generic/vector.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26843 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19 00:07:49 +00:00
Chris Lattner
c7029805ef Change the structure of lowering vector stuff. Note: This breaks some
things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26840 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-18 01:44:44 +00:00
Chris Lattner
0c486bdc22 add a couple enum values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26830 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-17 19:53:59 +00:00
Nate Begeman
81e8097377 Remove BRTWOWAY*
Make the PPC backend not dependent on BRTWOWAY_CC and make the branch
selector smarter about the code it generates, fixing a case in the
readme.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26814 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-17 01:40:33 +00:00
Chris Lattner
6cb7004c34 Fix a problem fully scalarizing values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26811 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-16 23:05:19 +00:00
Chris Lattner
199862b749 Add support for CopyFromReg from vector values. Note: this doesn't support
illegal vector types yet!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26799 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-16 19:57:50 +00:00
Chris Lattner
3c38449be6 Teach CreateRegForValue how to handle vector types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26798 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-16 19:51:18 +00:00
Chris Lattner
3a59358499 set TransformToType correctly for vector types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26797 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-16 19:50:01 +00:00
Chris Lattner
28b5b1c7b5 add support for vector->vector casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26788 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-15 22:19:46 +00:00
Chris Lattner
06ac6ab938 Add a note, this code should be moved to the dag combiner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26787 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-15 22:19:18 +00:00
Jim Laskey
9d0ff8e6f9 Expand subprogram and added block descriptor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26782 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-15 19:09:58 +00:00
Jim Laskey
2140798cc4 1. Use null for serialized empty strings.
2. Allow for user defined debug descriptors.
3. Allow for user augmented fields on debug descriptors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26760 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 18:37:57 +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
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
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
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
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
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
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
Evan Cheng
0937103368 Added a parameter to control whether Constant::getStringValue() would chop
off the result string at the first null terminator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26704 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 23:52:03 +00:00
Chris Lattner
7d74d1145f scrape out bits of llvm-db
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26701 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 22:48:19 +00:00
Chris Lattner
a34b6f8713 Move simple-selector-specific types to the simple selector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26693 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 07:51:18 +00:00
Chris Lattner
20a4921791 Simplify the interface to the schedulers, to not pass the selected heuristicin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26692 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 07:49:12 +00:00
Chris Lattner
2f5806c2b3 Move some simple-sched-specific instance vars to the simple scheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26690 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 07:42:02 +00:00
Chris Lattner
1e433c59e0 prune #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26689 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 07:37:35 +00:00
Chris Lattner
e76074ab89 move some simple scheduler methods into the simple scheduler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26688 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 07:35:21 +00:00
Chris Lattner
8c7ef0599c Make EmitNode take a SDNode instead of a NodeInfo*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26687 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 07:28:36 +00:00
Chris Lattner
df3750642a Move the VRBase field from NodeInfo to being a separate, explicit, map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26686 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 07:25:12 +00:00
Chris Lattner
8d41651da7 no need to build groups anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26684 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 07:15:58 +00:00
Chris Lattner
b2042e31a7 Create SUnits directly from the SelectionDAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26683 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 07:13:32 +00:00
Chris Lattner
be24e5996c Push PrepareNodeInfo/IdentifyGroups down the inheritance hierarchy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26682 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 06:34:51 +00:00
Chris Lattner
da4ff69153 Teach the latency scheduler some new tricks. In particular, to break ties,
keep track of a sense of "mobility", i.e. how many other nodes scheduling one
node will free up.  For something like this:

float testadd(float *X, float *Y, float *Z, float *W, float *V) {
  return (*X+*Y)*(*Z+*W)+*V;
}

For example, this makes us schedule *X then *Y, not *X then *Z.  The former
allows us to issue the add, the later only lets us issue other loads.

This turns the above code from this:

_testadd:
        lfs f0, 0(r3)
        lfs f1, 0(r6)
        lfs f2, 0(r4)
        lfs f3, 0(r5)
        fadds f0, f0, f2
        fadds f1, f3, f1
        lfs f2, 0(r7)
        fmadds f1, f0, f1, f2
        blr

into this:

_testadd:
        lfs f0, 0(r6)
        lfs f1, 0(r5)
        fadds f0, f1, f0
        lfs f1, 0(r4)
        lfs f2, 0(r3)
        fadds f1, f2, f1
        lfs f2, 0(r7)
        fmadds f1, f1, f0, f2
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26680 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 05:51:05 +00:00
Chris Lattner
f83a47d905 add an aggregate method for reinserting scheduled nodes, add a callback for
priority impls that want to be notified when a node is scheduled


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26678 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-10 04:32:49 +00:00