Commit Graph

13435 Commits

Author SHA1 Message Date
Chris Lattner e7a058de7d add the vperm instruction
llvm-svn: 26883
2006-03-20 01:00:56 +00:00
Chris Lattner 00f0589bc0 Add very basic support for VECTOR_SHUFFLE
llvm-svn: 26880
2006-03-19 23:56:04 +00:00
Chris Lattner d16f6fdd49 add a note with a testcase
llvm-svn: 26877
2006-03-19 22:27:41 +00:00
Chris Lattner 169e6238ad Add a note about the MUL -> FMADD vector bug.
llvm-svn: 26874
2006-03-19 22:08:08 +00:00
Chris Lattner d783c76c18 Teach cee to propagate through switch statements. This implements
Transforms/CorrelatedExprs/switch.ll

Patch contributed by Eric Kidd!

llvm-svn: 26872
2006-03-19 19:37:24 +00:00
Evan Cheng f7c2e3628b Vector undef's
llvm-svn: 26870
2006-03-19 09:38:54 +00:00
Chris Lattner 7e9440a4fc Custom lower SCALAR_TO_VECTOR into lve*x.
llvm-svn: 26868
2006-03-19 06:55:52 +00:00
Chris Lattner 79fb91cc69 Allow SCALAR_TO_VECTOR to be custom lowered.
llvm-svn: 26867
2006-03-19 06:47:21 +00:00
Chris Lattner 9cdc5a0ce7 Add SCALAR_TO_VECTOR support
llvm-svn: 26866
2006-03-19 06:31:19 +00:00
Chris Lattner b1ee9c7e24 PPC doesn't have SCALAR_TO_VECTOR
llvm-svn: 26865
2006-03-19 06:17:19 +00:00
Chris Lattner 5b595af956 add support for vector undef
llvm-svn: 26863
2006-03-19 06:10:09 +00:00
Evan Cheng 0a03f789c2 Remind us of exit value substitution
llvm-svn: 26862
2006-03-19 06:09:23 +00:00
Evan Cheng 5111c81a3c Turning on LSR by default
llvm-svn: 26861
2006-03-19 06:08:49 +00:00
Evan Cheng 66a9c0dea7 Remember which tests are hurt by LSR.
llvm-svn: 26860
2006-03-19 06:08:11 +00:00
Chris Lattner eb5b2e705c Don't bother storing undef elements of BUILD_VECTOR's
llvm-svn: 26858
2006-03-19 05:46:04 +00:00
Chris Lattner 0c9eb670bb minor fixes
llvm-svn: 26857
2006-03-19 05:43:01 +00:00
Chris Lattner ea6468758d notes
llvm-svn: 26856
2006-03-19 05:33:30 +00:00
Chris Lattner 431c90c9fa we don't use lmw/stmw. When we want them they are easy enough to add
llvm-svn: 26853
2006-03-19 04:33:37 +00:00
Chris Lattner 5d3ff12c8f Implement expand of BUILD_VECTOR containing variable elements.
This implements CodeGen/Generic/vector.ll:test_variable_buildvector

llvm-svn: 26852
2006-03-19 04:18:56 +00:00
Chris Lattner 5336a59e4b fold insertelement(buildvector) -> buildvector if the inserted element # is
a constant.  This implements test_constant_insert in CodeGen/Generic/vector.ll

llvm-svn: 26851
2006-03-19 01:27:56 +00:00
Chris Lattner 29b2301460 implement basic support for INSERT_VECTOR_ELT.
llvm-svn: 26849
2006-03-19 01:17:20 +00:00
Chris Lattner f7b6e7212f rename these nodes
llvm-svn: 26848
2006-03-19 01:13:28 +00:00
Chris Lattner f4e1a53647 Rename ConstantVec -> BUILD_VECTOR and VConstant -> VBUILD_VECTOR. Allow*BUILD_VECTOR to take variable inputs.
llvm-svn: 26847
2006-03-19 00:52:58 +00:00
Chris Lattner c16b05e67d implement vector.ll:test_undef
llvm-svn: 26845
2006-03-19 00:20:20 +00:00
Chris Lattner 93640543a9 Fix the remaining bugs in the vector expansion rework I commited yesterday.
This fixes CodeGen/Generic/vector.ll

llvm-svn: 26843
2006-03-19 00:07:49 +00:00
Evan Cheng c28282bd87 - Fixed a bogus if condition.
- Added more debugging info.
- Allow reuse of IV of negative stride. e.g. -4 stride == 2 * iv of -2 stride.

llvm-svn: 26841
2006-03-18 08:03:12 +00:00
Chris Lattner 32206f54c6 Change the structure of lowering vector stuff. Note: This breaks some
things.

llvm-svn: 26840
2006-03-18 01:44:44 +00:00
Evan Cheng 9bf978dc20 Use the generic vector register classes VR64 / VR128 rather than V4F32,
V8I16, etc.

llvm-svn: 26838
2006-03-18 01:23:20 +00:00
Evan Cheng f09f0ebd48 Sort StrideOrder so we can process the smallest strides first. This allows
for more IV reuses.

llvm-svn: 26837
2006-03-18 00:44:49 +00:00
Nate Begeman 21f87d0e4c Fix subfic to match subc by default instead of sub so that it is correctly
cost-modeled as producing a flag.  This fixes the test I just added for neg

llvm-svn: 26835
2006-03-17 22:41:37 +00:00
Evan Cheng b09a56f3a4 Darwin should use _setjmp/_longjmp instead of setjmp/longjmp.
llvm-svn: 26833
2006-03-17 20:31:41 +00:00
Evan Cheng 4f674921d6 Move some pattern fragments to the right files.
llvm-svn: 26831
2006-03-17 19:55:52 +00:00
Chris Lattner 98931bc381 add a couple enum values
llvm-svn: 26830
2006-03-17 19:53:59 +00:00
Evan Cheng 4520698820 Allow users of iv / stride to be rewritten with expression that is a multiply
of a smaller stride even if they have a common loop invariant expression part.

llvm-svn: 26828
2006-03-17 19:52:23 +00:00
Chris Lattner 388fc4d9fb Disable x86 fastcc from passing args in registers
llvm-svn: 26824
2006-03-17 17:27:47 +00:00
Reid Spencer 779c10818c Fix use of LEVEL.
llvm-svn: 26822
2006-03-17 07:39:44 +00:00
Reid Spencer ee4b4f55ee Two fixes:
1. Allow building of Intrinsics.gen to work for srcdir != objdir
2. Add a rule for installation of Intrinsics.gen.

llvm-svn: 26819
2006-03-17 06:27:06 +00:00
Chris Lattner 43798850f9 Parameterize the number of integer arguments to pass in registers
llvm-svn: 26818
2006-03-17 05:10:20 +00:00
Evan Cheng bfc2e97383 Also fold MOV8r0, MOV16r0, MOV32r0 + store to MOV8mi, MOV16mi, and MOV32mi.
llvm-svn: 26817
2006-03-17 02:36:22 +00:00
Evan Cheng aca7915b70 Add some missing entries to X86RegisterInfo::foldMemoryOperand(). e.g.
ADD32ri8.

llvm-svn: 26816
2006-03-17 02:25:01 +00:00
Evan Cheng 27750f3287 - Nuke 16-bit SBB instructions. We'll never use them.
- Nuke a bogus comment.

llvm-svn: 26815
2006-03-17 02:24:04 +00:00
Nate Begeman bb01d4f272 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.

llvm-svn: 26814
2006-03-17 01:40:33 +00:00
Chris Lattner 8bf1c59e7f remove dead variable
llvm-svn: 26813
2006-03-16 23:52:08 +00:00
Chris Lattner 7ececaad83 Fix a problem fully scalarizing values.
llvm-svn: 26811
2006-03-16 23:05:19 +00:00
Evan Cheng c11fcceec5 A new entry.
llvm-svn: 26810
2006-03-16 22:44:22 +00:00
Nate Begeman fb0e36fa56 Notes on how to kill the eeevil brtwoway, and make ppc branch selector
more target independant, generate better code, and be less conservative.

llvm-svn: 26809
2006-03-16 22:37:48 +00:00
Chris Lattner 1e6dfa4c1f Strangely, calls clobber call-clobbered vector regs. Whodathoughtit?
llvm-svn: 26808
2006-03-16 22:35:59 +00:00
Chris Lattner 325bb46315 add a note
llvm-svn: 26807
2006-03-16 22:25:55 +00:00
Chris Lattner 91400bd413 teach the ppc backend how to spill/reload vector regs
llvm-svn: 26806
2006-03-16 22:24:02 +00:00
Chris Lattner 6e90062416 add callee saved vector regs
llvm-svn: 26805
2006-03-16 22:07:06 +00:00
Evan Cheng f75555feb9 Bug fix: condition inverted.
llvm-svn: 26804
2006-03-16 22:02:48 +00:00
Evan Cheng 3df447d354 For each loop, keep track of all the IV expressions inserted indexed by
stride. For a set of uses of the IV of a stride which is a multiple
of another stride, do not insert a new IV expression. Rather, reuse the
previous IV and rewrite the uses as uses of IV expression multiplied by
the factor.

e.g.
x = 0 ...; x ++
y = 0 ...; y += 4
then use of y can be rewritten as use of 4*x for x86.

llvm-svn: 26803
2006-03-16 21:53:05 +00:00
Evan Cheng 20931a798e Added a way for TargetLowering to specify what values can be used as the
scale component of the target addressing mode.

llvm-svn: 26802
2006-03-16 21:47:42 +00:00
Chris Lattner 0b27047a6c in functions that use a lot of callee saved regs, this can be more than
5 instructions away.

llvm-svn: 26801
2006-03-16 21:31:45 +00:00
Chris Lattner fd9f3e8ed3 Add support for copying registers. still needed: spilling and reloading them
llvm-svn: 26800
2006-03-16 20:03:58 +00:00
Chris Lattner 8471b15706 Add support for CopyFromReg from vector values. Note: this doesn't support
illegal vector types yet!

llvm-svn: 26799
2006-03-16 19:57:50 +00:00
Chris Lattner 49409cb925 Teach CreateRegForValue how to handle vector types.
llvm-svn: 26798
2006-03-16 19:51:18 +00:00
Chris Lattner ad74844bfa set TransformToType correctly for vector types.
llvm-svn: 26797
2006-03-16 19:50:01 +00:00
Nate Begeman 32e73f9881 Another case we could do better on.
llvm-svn: 26795
2006-03-16 18:50:44 +00:00
Chris Lattner 1678a6c477 Save/restore VRSAVE once per function, not once per block.
llvm-svn: 26793
2006-03-16 18:25:23 +00:00
Chris Lattner 4b41e40621 add support for the bitconvert node
llvm-svn: 26789
2006-03-16 01:29:53 +00:00
Chris Lattner 4024c00ce7 add support for vector->vector casts
llvm-svn: 26788
2006-03-15 22:19:46 +00:00
Chris Lattner cad70c3e46 Add a note, this code should be moved to the dag combiner.
llvm-svn: 26787
2006-03-15 22:19:18 +00:00
Chris Lattner 6d6084fd04 Teach the strip pass to strip type names in addition to value names. This
is fallout from the type/value split in the symtab long long ago :)

llvm-svn: 26785
2006-03-15 19:22:41 +00:00
Jim Laskey 71050ba709 Expand subprogram and added block descriptor.
llvm-svn: 26782
2006-03-15 19:09:58 +00:00
Andrew Lenharth b3dae7cfa9 no heap is happening here
llvm-svn: 26781
2006-03-15 19:03:16 +00:00
Andrew Lenharth c0b65305f1 remove qsort for now
llvm-svn: 26779
2006-03-15 18:32:18 +00:00
Andrew Lenharth fb4df2055f allow field sensitivity to be a tunable parameter
llvm-svn: 26777
2006-03-15 05:43:41 +00:00
Nate Begeman 2e1fde7c5c Update scheduling info for vrsave instruction
llvm-svn: 26776
2006-03-15 05:25:05 +00:00
Andrew Lenharth 3196422df0 Handle one offset with growth case seen in povray. Namely, if we have an offset,
and the offset lands at a field boundary in the old type, construct a new type,
copying the fields masked by the offset from the old type, and unify with that.

llvm-svn: 26775
2006-03-15 04:04:21 +00:00
Andrew Lenharth c254e5b180 improve mem intrinsics and add a few things povray uses
llvm-svn: 26774
2006-03-15 03:43:59 +00:00
Chris Lattner 6995470323 Bugfix, unbreaking CodeGen/PowerPC/cttz.ll
llvm-svn: 26764
2006-03-14 19:49:57 +00:00
Chris Lattner 6d4a221d80 Fix an et-forest memory leak. Patch by Daniel Berlin.
llvm-svn: 26763
2006-03-14 19:41:45 +00:00
Chris Lattner 5271a1f9b5 add a note
llvm-svn: 26762
2006-03-14 19:31:24 +00:00
Jim Laskey b8e155567a 1. Use null for serialized empty strings.
2. Allow for user defined debug descriptors.
3. Allow for user augmented fields on debug descriptors.

llvm-svn: 26760
2006-03-14 18:37:57 +00:00
Chris Lattner ab1ed2aa96 Fix an off by one error that caused PPC LLC failures last night.
llvm-svn: 26758
2006-03-14 17:56:49 +00:00
Chris Lattner c5f866bb4a 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

llvm-svn: 26757
2006-03-14 16:04:29 +00:00
Chris Lattner 2fc319d444 extract some code into a method, no functionality change
llvm-svn: 26755
2006-03-14 07:11:11 +00:00
Chris Lattner 30402be175 transformation implemented
llvm-svn: 26754
2006-03-14 06:57:34 +00:00
Chris Lattner d6bde46d85 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

llvm-svn: 26753
2006-03-14 06:55:18 +00:00
Reid Spencer c67a060a51 Convert llvm.cs.uiuc.edu -> llvm.org
llvm-svn: 26748
2006-03-14 05:54:52 +00:00
Jim Laskey cf0bdffe6d 1. Handle removal of all arguments for a morphed intrinsic.
2. Remove the declaration of llvm.dbg.declare.

llvm-svn: 26745
2006-03-14 02:00:35 +00:00
Evan Cheng 0f9d6534f5 PPC LSR pass should use target lowering hooks.
llvm-svn: 26743
2006-03-13 23:56:51 +00:00
Evan Cheng 2dd2c652b2 Added getTargetLowering() to TargetMachine. Refactored targets to support this.
llvm-svn: 26742
2006-03-13 23:20:37 +00:00
Evan Cheng 60f495100a Update
llvm-svn: 26741
2006-03-13 23:19:10 +00:00
Evan Cheng af598d2461 Add LSR hooks.
llvm-svn: 26740
2006-03-13 23:18:16 +00:00
Evan Cheng c567c4efbb Added target lowering hooks which LSR consults to make more intelligent
transformation decisions.

llvm-svn: 26738
2006-03-13 23:14:23 +00:00
Chris Lattner 2b8eb375d7 Handle builtins that directly correspond to GCC builtins.
llvm-svn: 26737
2006-03-13 23:09:05 +00:00
Chris Lattner 02e2c18c9c 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

llvm-svn: 26733
2006-03-13 21:52:10 +00:00
Chris Lattner 68ac09d5cb make sure dead token factor nodes are removed by the dag combiner.
llvm-svn: 26731
2006-03-13 18:37:30 +00:00
Reid Spencer 611f965820 Bring makefile back into compliance with standard by using
$(Echo) instead of @echo

llvm-svn: 26730
2006-03-13 17:57:31 +00:00
Jim Laskey acb6e34277 Handle the removal of the debug chain.
llvm-svn: 26729
2006-03-13 13:07:37 +00:00
Chris Lattner fe4c7fb7ae remove two implemented items
llvm-svn: 26728
2006-03-13 06:52:22 +00:00
Chris Lattner d8c2a48d58 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.

llvm-svn: 26727
2006-03-13 06:51:27 +00:00
Chris Lattner 3d761b6211 I can't convince myself that this is safe, remove the recursive call.
llvm-svn: 26725
2006-03-13 06:42:16 +00:00
Chris Lattner 8bb6cb7d7b add a couple of missing folds
llvm-svn: 26724
2006-03-13 06:26:26 +00:00
Chris Lattner 994d8e6bd4 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.

llvm-svn: 26723
2006-03-13 06:08:38 +00:00
Chris Lattner ec9d0bc3ec Fix a couple of bugs that broke the alpha tester build
llvm-svn: 26722
2006-03-13 05:23:59 +00:00
Chris Lattner 4fbb612685 Handle cracked instructions in dispatch group formation.
llvm-svn: 26721
2006-03-13 05:20:04 +00:00
Chris Lattner 7579cfb1a0 Mark instructions that are cracked by the PPC970 decoder as such.
llvm-svn: 26720
2006-03-13 05:15:10 +00:00
Chris Lattner 51348c5f27 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.

llvm-svn: 26719
2006-03-12 09:13:49 +00:00
Chris Lattner a767dbf197 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.

llvm-svn: 26718
2006-03-12 09:01:41 +00:00
Chris Lattner 86a9b60a25 Chain operands aren't real uses: they don't require the full latency of the
predecessor to finish before they can start.

llvm-svn: 26717
2006-03-12 03:52:09 +00:00
Chris Lattner 572003ca15 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

llvm-svn: 26716
2006-03-12 00:38:57 +00:00
Chris Lattner 356183d91e rename priorityqueue -> availablequeue. When a node is scheduled, remember
which cycle it lands on.

llvm-svn: 26714
2006-03-11 22:44:37 +00:00
Chris Lattner 063086b0f4 Make CurrCycle a local var instead of an instance var
llvm-svn: 26713
2006-03-11 22:34:41 +00:00
Chris Lattner 9995a0c019 Move some methods around so that BU specific code is together, TD specific code
is together, and direction independent code is together.

llvm-svn: 26712
2006-03-11 22:28:35 +00:00
Chris Lattner 578d8fcb59 merge preds/chainpreds -> preds set
merge succs/chainsuccs -> succs set

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

llvm-svn: 26711
2006-03-11 22:24:20 +00:00
Chris Lattner d03132a409 blr is a branch too
llvm-svn: 26710
2006-03-11 21:49:49 +00:00
Chris Lattner 4e56b686f1 add an example
llvm-svn: 26709
2006-03-11 20:20:40 +00:00
Chris Lattner 003f633036 add a note
llvm-svn: 26708
2006-03-11 20:17:08 +00:00
Nate Begeman d5811b965d Fix PR681 by using the standard Lengauer and Tarjan algorithm for dominator
set construction, rather than intersecting various std::sets.  This reduces
the memory usage for the testcase in PR681 from 496 to 26MB of ram on my
darwin system, and reduces the runtime from 32.8 to 0.8 seconds on a
2.5GHz G5.  This also enables future code sharing between Dom and PostDom
now that they share near-identical implementations.

llvm-svn: 26707
2006-03-11 02:20:46 +00:00
Evan Cheng 2c5e530430 Doh!
llvm-svn: 26705
2006-03-11 00:13:10 +00:00
Evan Cheng 38280c0020 Added a parameter to control whether Constant::getStringValue() would chop
off the result string at the first null terminator.

llvm-svn: 26704
2006-03-10 23:52:03 +00:00
Chris Lattner 8a18a823a0 remove some dead code
llvm-svn: 26703
2006-03-10 23:14:22 +00:00
Chris Lattner d3ef6c290a scrape out bits of llvm-db
llvm-svn: 26701
2006-03-10 22:48:19 +00:00
Chris Lattner 7d587f37ec Remove UnixLocalInferiorProcess: debugging via the JIT isn't a good idea.
Perhaps llvm-db will turn into a read debugger someday.

llvm-svn: 26700
2006-03-10 22:39:48 +00:00
Chris Lattner c2447e8b59 teach the JIT to encode vector registers
llvm-svn: 26697
2006-03-10 20:19:50 +00:00
Chris Lattner f918e15362 Move simple-selector-specific types to the simple selector.
llvm-svn: 26693
2006-03-10 07:51:18 +00:00
Chris Lattner 5255d04357 Simplify the interface to the schedulers, to not pass the selected heuristicin.
llvm-svn: 26692
2006-03-10 07:49:12 +00:00
Chris Lattner a5b93b8c6d Move some simple-sched-specific instance vars to the simple scheduler.
llvm-svn: 26690
2006-03-10 07:42:02 +00:00
Chris Lattner e015178de1 prune #includes
llvm-svn: 26689
2006-03-10 07:37:35 +00:00
Chris Lattner 4b70ff7876 move some simple scheduler methods into the simple scheduler
llvm-svn: 26688
2006-03-10 07:35:21 +00:00
Chris Lattner dc2f135f5c Make EmitNode take a SDNode instead of a NodeInfo*
llvm-svn: 26687
2006-03-10 07:28:36 +00:00
Chris Lattner b9d8fa0342 Move the VRBase field from NodeInfo to being a separate, explicit, map.
llvm-svn: 26686
2006-03-10 07:25:12 +00:00
Chris Lattner c48cfba44b no need to build groups anymore
llvm-svn: 26684
2006-03-10 07:15:58 +00:00
Chris Lattner 6f82fe8106 Create SUnits directly from the SelectionDAG.
llvm-svn: 26683
2006-03-10 07:13:32 +00:00
Chris Lattner 2f8c7c3d55 Push PrepareNodeInfo/IdentifyGroups down the inheritance hierarchy
llvm-svn: 26682
2006-03-10 06:34:51 +00:00
Chris Lattner 349e9ddccc 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

llvm-svn: 26680
2006-03-10 05:51:05 +00:00
Chris Lattner 25e2556b71 add an aggregate method for reinserting scheduled nodes, add a callback for
priority impls that want to be notified when a node is scheduled

llvm-svn: 26678
2006-03-10 04:32:49 +00:00
Jeff Cohen 6ce97687f7 Fix VC++ build breakage.
llvm-svn: 26676
2006-03-10 03:57:45 +00:00
Chris Lattner 60f6833376 use autogenerated side-effect information
llvm-svn: 26673
2006-03-09 22:38:10 +00:00
Chris Lattner bb40a9fa58 Use autogenerated mod/ref info for intrinsics.
llvm-svn: 26670
2006-03-09 22:31:29 +00:00
Chris Lattner 591693f3bf Use the autogenerated intrinsic verifier
llvm-svn: 26667
2006-03-09 22:06:04 +00:00
Evan Cheng 306c13a8fb Add option -enable-x86-lsr to enable x86 loop strength reduction pass.
llvm-svn: 26665
2006-03-09 21:51:28 +00:00
Chris Lattner ff4d4ee163 Use the function name matcher autogenerated from the .td file.
llvm-svn: 26664
2006-03-09 20:35:01 +00:00
Chris Lattner 285c95d7eb This rule also depends on tblgen
llvm-svn: 26662
2006-03-09 20:29:41 +00:00
Chris Lattner f136299635 add a note
llvm-svn: 26661
2006-03-09 20:13:21 +00:00
Chris Lattner 213209a248 remove dbg_declare, it's not used yet.
llvm-svn: 26659
2006-03-09 20:02:42 +00:00
Chris Lattner ea0aa2868f silly case insensitive file systems...
llvm-svn: 26658
2006-03-09 19:55:06 +00:00
Chris Lattner 83e6e19936 Build intrinsics.gen from intrinsics.td
llvm-svn: 26657
2006-03-09 19:53:27 +00:00
Chris Lattner ab8d2ba046 autoupgrade memcpy/memmove/memset with signed counts.
CVS: ----------------------------------------------------------------------

llvm-svn: 26654
2006-03-09 18:42:10 +00:00
Andrew Lenharth 43e569c95f these are copies too
llvm-svn: 26653
2006-03-09 18:18:51 +00:00
Chris Lattner 7e7dccd3ab remove some now-dead code
llvm-svn: 26652
2006-03-09 18:07:49 +00:00
Andrew Lenharth 70236fc12f fcopysign for mixed mode
llvm-svn: 26651
2006-03-09 17:56:33 +00:00
Chris Lattner f0fc6bbaf3 back out my previous hack
llvm-svn: 26650
2006-03-09 17:48:46 +00:00
Andrew Lenharth ebfd94fa1d relax fcopysign
llvm-svn: 26649
2006-03-09 17:47:22 +00:00
Andrew Lenharth 4a87e7d9a3 alpha and llvm have different oppinions on which arg is the sign bit
llvm-svn: 26647
2006-03-09 17:41:50 +00:00
Chris Lattner c6c9e65301 remove temporary option
llvm-svn: 26646
2006-03-09 17:31:22 +00:00
Andrew Lenharth 16b96d2cb4 Alpha Scheduling classes
llvm-svn: 26643
2006-03-09 17:16:45 +00:00
Chris Lattner c44be2c4ef temporary hack to get the build working again, apparently a header
commit was forgotten

llvm-svn: 26642
2006-03-09 17:11:08 +00:00
Andrew Lenharth ed7a293b44 fcopysign and get rid of dsnode cruft. custom PA runtimes make this better in some senses
llvm-svn: 26641
2006-03-09 14:58:25 +00:00
Andrew Lenharth b8a06a7c6c fcopysign support
llvm-svn: 26640
2006-03-09 14:57:36 +00:00
Jim Laskey 4b0e1d9e6c Move bit field endianness to backend.
llvm-svn: 26639
2006-03-09 13:28:47 +00:00
Chris Lattner d17d77aa1d yes yes, enabled debug output is bad
llvm-svn: 26637
2006-03-09 07:39:25 +00:00
Chris Lattner 6398c13128 switch the t-d scheduler to use a really dumb and trivial critical path
latency priority function.

llvm-svn: 26636
2006-03-09 07:38:27 +00:00
Chris Lattner d4130375c0 Pull latency information for target instructions out of the latency tables. :)
Only enable this with -use-sched-latencies, I'll enable it by default with a
clean nightly tester run tonight.

PPC is the only target that provides latency info currently.

llvm-svn: 26634
2006-03-09 07:15:18 +00:00
Chris Lattner da6aafeef4 don't copy all itinerary data
llvm-svn: 26633
2006-03-09 07:13:00 +00:00
Chris Lattner 399bee27f0 PriorityQueue is an instance var, use it.
llvm-svn: 26632
2006-03-09 06:48:37 +00:00
Chris Lattner 9e95accf4e add some comments
llvm-svn: 26631
2006-03-09 06:37:29 +00:00
Chris Lattner 9df647539d Refactor the priority mechanism one step further: now that it is a separate
class, sever its implementation from the interface.  Now we can provide new
implementations of the same interface (priority computation) without touching
the scheduler itself.

llvm-svn: 26630
2006-03-09 06:35:14 +00:00
Chris Lattner e363fdf318 Add support for 'special' llvm globals like debug info and static ctors/dtors.
llvm-svn: 26628
2006-03-09 06:14:35 +00:00
Chris Lattner 6b7847a5bc fix a pasto
llvm-svn: 26627
2006-03-09 06:09:41 +00:00
Chris Lattner 920e661e50 a couple of miscellaneous things.
llvm-svn: 26625
2006-03-09 01:39:46 +00:00
Jim Laskey 8f0a95f664 Add #line support for CBE.
llvm-svn: 26621
2006-03-08 19:31:15 +00:00
Chris Lattner faae50b66b Add a helper method for running static ctors/dtors in the module.
llvm-svn: 26619
2006-03-08 18:42:46 +00:00
Chris Lattner 48a8e09ad0 add a new helper method.
llvm-svn: 26618
2006-03-08 18:39:13 +00:00
Jim Laskey 2698f0de7a Get rid of the multiple copies of getStringValue. Now a Constant:: method.
llvm-svn: 26616
2006-03-08 18:11:07 +00:00
Duraid Madina 5005b01c20 doo de doo
llvm-svn: 26614
2006-03-08 06:18:46 +00:00
Chris Lattner fd22d42945 Split the priority function computation and priority queue management out
of the ScheduleDAGList class into a new SchedulingPriorityQueue class.

llvm-svn: 26613
2006-03-08 05:18:27 +00:00
Chris Lattner 42e2026cb0 switch from an explicitly managed list of SUnits to a simple vector of sunits
llvm-svn: 26612
2006-03-08 04:54:34 +00:00
Chris Lattner 12c6d89204 Shrinkify some fields, fit to 80 columns
llvm-svn: 26611
2006-03-08 04:41:06 +00:00
Chris Lattner 3fe975b846 revert the previous patch, didn't mean to check it in yet
llvm-svn: 26610
2006-03-08 04:39:05 +00:00
Chris Lattner af5e26c980 remove "Slot", it is dead
llvm-svn: 26609
2006-03-08 04:37:58 +00:00
Chris Lattner 543832d39d Change the interface for getting a target HazardRecognizer to be more clean.
llvm-svn: 26608
2006-03-08 04:25:59 +00:00
Jim Laskey 2370265550 libstdc++-v3 was failing to build. Needed to handle composite types with empty
members (running into a zero initializer.)

llvm-svn: 26607
2006-03-08 02:07:02 +00:00
Chris Lattner fc34f8bb48 Fix a miscompilation of 188.ammp with the new CFE. 188.ammp is accessing
arrays out of range in a horrible way, but we shouldn't break it anyway.
Details in the comments.

llvm-svn: 26606
2006-03-08 01:05:29 +00:00
Chris Lattner a8dd636192 add a note
llvm-svn: 26605
2006-03-08 00:25:47 +00:00
Evan Cheng 70b25efa57 X86ISD::REP_STOS and X86ISD::REP_MOVS now produces a flag.
llvm-svn: 26604
2006-03-07 23:34:23 +00:00
Evan Cheng adc7093fc1 Use rep/stosl; and Count 0x3; rep/stosb for memset with 4 byte aligned dest.
and variable value.
Similarly for memcpy.

llvm-svn: 26603
2006-03-07 23:29:39 +00:00
Chris Lattner 207291fd1a Two things:
1. Don't emit debug info, or other llvm.metadata to the .cbe.c file.
2. Mark static ctors/dtors as such, so that bugpoint works on C++ code
   compiled with the new CFE.

llvm-svn: 26602
2006-03-07 22:58:23 +00:00
Jim Laskey 313570fb17 Use "llvm.metadata" section for debug globals. Filter out these globals in the
asm printer.

llvm-svn: 26599
2006-03-07 22:00:35 +00:00
Jim Laskey 69effa2325 Switch to using a numeric id for anchors.
llvm-svn: 26598
2006-03-07 20:53:47 +00:00
Chris Lattner 7b87fd53f9 Fix ConstantMerge/2006-03-07-DontMergeDiffSections.ll, a problem Jim
hypotheticalized about, where we would incorrectly merge two globals in
different sections.

llvm-svn: 26597
2006-03-07 17:56:59 +00:00
Chris Lattner 907e13c742 add another missing store.
llvm-svn: 26595
2006-03-07 16:26:48 +00:00
Chris Lattner 8c73d80b08 add a couple more load/store instrs, add a newline to the end of file.
llvm-svn: 26594
2006-03-07 16:19:46 +00:00
Jim Laskey 3bad199894 Bitfield support.
llvm-svn: 26593
2006-03-07 15:51:33 +00:00
Nate Begeman 3e3219cc0a This kinda sorta implements "things that have to lead a dispatch group".
llvm-svn: 26591
2006-03-07 08:30:27 +00:00
Chris Lattner 675567f77c add some new instructions to the classifier. With this, we correctly insert
a nop into Freebench/neural, which speeds it up from 136->129s (~5.4%).

llvm-svn: 26590
2006-03-07 07:14:55 +00:00
Chris Lattner 05ad128dca add some comments that describe what we model
llvm-svn: 26588
2006-03-07 06:44:19 +00:00
Chris Lattner 2cab13573c Implement a very very simple hazard recognizer for LSU rejects and ctr set/read
flushes

llvm-svn: 26587
2006-03-07 06:32:48 +00:00
Chris Lattner 0c801bd1cf Fix some formatting, when looking for hazards, prefer target nodes over
things like copyfromreg.

llvm-svn: 26586
2006-03-07 05:40:43 +00:00
Chris Lattner 883cefc656 add a note
llvm-svn: 26585
2006-03-07 04:42:59 +00:00
Chris Lattner bccb0e07f0 add a note
llvm-svn: 26583
2006-03-07 02:46:26 +00:00
Evan Cheng a4a4ceb478 - Emit subsections_via_symbols for Darwin.
- Conditionalize Dwarf debugging output (Darwin only for now).

llvm-svn: 26582
2006-03-07 02:23:26 +00:00
Evan Cheng 30d7b70b73 Enable Dwarf debugging info.
llvm-svn: 26581
2006-03-07 02:02:57 +00:00
Chris Lattner 53ef5a032c Teach the alignment handling code to look through constant expr casts and GEPs
llvm-svn: 26580
2006-03-07 01:28:57 +00:00
Chris Lattner 82f2ef20b6 Teach instcombine to increase the alignment of memset/memcpy/memmove when
the pointer is known to come from either a global variable, alloca or
malloc.  This allows us to compile this:

  P = malloc(28);
  memset(P, 0, 28);

into explicit stores on PPC instead of a memset call.

llvm-svn: 26577
2006-03-06 20:18:44 +00:00
Chris Lattner 01aa752a36 update file comment
llvm-svn: 26573
2006-03-06 17:58:04 +00:00
Evan Cheng a00c61932d Remove some code that doesn't make sense
llvm-svn: 26572
2006-03-06 07:31:44 +00:00
Evan Cheng c5c0658aa6 Remove SUnit::Priority1: it is re-calculated on demand as number of live
range to be generated.

llvm-svn: 26570
2006-03-06 06:08:54 +00:00
Chris Lattner 47639dbb93 Hoist the HazardRecognizer out of the ScheduleDAGList.cpp file to where
targets can implement them.  Make the top-down scheduler non-g5-specific.

Remove the old testing hazard recognizer.

llvm-svn: 26569
2006-03-06 00:22:00 +00:00
Chris Lattner 00b52ea8f9 Comment fixes
llvm-svn: 26567
2006-03-05 23:59:20 +00:00
Chris Lattner 80268aaeed Don't depend on the C99 copysign function, implement it ourselves.
llvm-svn: 26566
2006-03-05 23:57:58 +00:00
Chris Lattner 2d945ba4c7 When a hazard recognizer needs noops to be inserted, do so. This represents
noops as null pointers in the instruction sequence.

llvm-svn: 26564
2006-03-05 23:51:47 +00:00
Chris Lattner ea79d9fd73 implement TII::insertNoop
llvm-svn: 26562
2006-03-05 23:49:55 +00:00
Chris Lattner fa5e1c9c26 Implement G5HazardRecognizer as a trivial thing that wants 5 cycles between
copyfromreg nodes.  Clearly useful!

llvm-svn: 26559
2006-03-05 23:13:56 +00:00
Chris Lattner e50c092b7c Add basic hazard recognizer support. noop insertion isn't complete yet though.
llvm-svn: 26558
2006-03-05 22:45:01 +00:00
Jeff Cohen 55e2aac24b Fix VC++ compilation error.
llvm-svn: 26554
2006-03-05 21:43:37 +00:00
Chris Lattner 98ecb8ec61 Split the list scheduler into top-down and bottom-up pieces. The priority
function of the top-down scheduler are completely bogus currently, and
having (future) PPC specific in this file is also wrong, but this is a
small incremental step.

llvm-svn: 26552
2006-03-05 21:10:33 +00:00
Chris Lattner 7a36d97518 Move the available queue to being inside the ListSchedule method, since it
bounds its lifetime.

llvm-svn: 26550
2006-03-05 20:21:55 +00:00
Chris Lattner 5032c32d30 add a note
llvm-svn: 26549
2006-03-05 20:00:08 +00:00
Chris Lattner bdaf4f38b5 Reinstate this now that the offending opposite xform has been removed.
llvm-svn: 26548
2006-03-05 19:53:55 +00:00
Chris Lattner c726a5c31f Do not fold (add (shl x, c1), (shl c2, c1)) -> (shl (add x, c2), c1),
we want to canonicalize the other way.

llvm-svn: 26547
2006-03-05 19:52:57 +00:00
Chris Lattner c610e62e46 print arbitrary constant pool entries
llvm-svn: 26545
2006-03-05 09:38:03 +00:00
Evan Cheng d428e22c07 Back out fold (shl (add x, c1), c2) -> (add (shl x, c2), c1<<c2) for now.
It's causing an infinite loop compiling ldecod on x86 / Darwin.

llvm-svn: 26544
2006-03-05 07:30:16 +00:00
Chris Lattner 3bc4050217 Add some simple copysign folds
llvm-svn: 26543
2006-03-05 05:30:57 +00:00
Chris Lattner 5c1ba2ac08 Codegen copysign[f] into a FCOPYSIGN node
llvm-svn: 26542
2006-03-05 05:09:38 +00:00
Chris Lattner 9c7f50376a Copysign needs to be expanded everywhere. Note that Alpha and IA64 should
implement copysign as a native op if they have it.

llvm-svn: 26541
2006-03-05 05:08:37 +00:00
Chris Lattner c2dd7aae71 add a note for something evan noticed
llvm-svn: 26539
2006-03-05 01:15:18 +00:00
Chris Lattner 6bc98653c2 Make vector narrowing more effective, implementing
Transforms/InstCombine/vec_narrow.ll.  This add support for narrowing
extract_element(insertelement) also.

llvm-svn: 26538
2006-03-05 00:22:33 +00:00
Chris Lattner 8d8b4cf63d Implemented.
llvm-svn: 26536
2006-03-04 23:33:44 +00:00
Chris Lattner f29f5204cc fold (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2)
fold (shl (add x, c1), c2) -> (add (shl x, c2), c1<<c2)

This allows us to compile CodeGen/PowerPC/addi-reassoc.ll into:

_test1:
        slwi r2, r4, 4
        add r2, r2, r3
        lwz r3, 36(r2)
        blr
_test2:
        mulli r2, r4, 5
        add r2, r2, r3
        lbz r2, 11(r2)
        extsb r3, r2
        blr

instead of:

_test1:
        addi r2, r4, 2
        slwi r2, r2, 4
        add r2, r3, r2
        lwz r3, 4(r2)
        blr
_test2:
        addi r2, r4, 2
        mulli r2, r2, 5
        add r2, r3, r2
        lbz r2, 1(r2)
        extsb r3, r2
        blr

llvm-svn: 26535
2006-03-04 23:33:26 +00:00
Chris Lattner 3e19c23765 Fix a crash compiling Obsequi
llvm-svn: 26529
2006-03-04 21:48:01 +00:00
Chris Lattner 4c065091d8 Add factoring of multiplications, e.g. turning A*A+A*B into A*(A+B).
Testcase here: Transforms/Reassociate/mulfactor.ll

llvm-svn: 26524
2006-03-04 09:31:13 +00:00
Chris Lattner c9a318d8fa Add a note
llvm-svn: 26523
2006-03-04 08:44:51 +00:00
Chris Lattner adf5ec6f96 Regenerate
llvm-svn: 26522
2006-03-04 07:53:41 +00:00
Chris Lattner a33bcff313 Don't use invalidated iterators!
llvm-svn: 26521
2006-03-04 07:53:16 +00:00
Evan Cheng c66fd44541 Add an entry
llvm-svn: 26520
2006-03-04 07:49:50 +00:00
Chris Lattner 32c01df299 Canonicalize (X+C1)*C2 -> X*C2+C1*C2
This implements Transforms/InstCombine/add.ll:test31

llvm-svn: 26519
2006-03-04 06:04:02 +00:00
Evan Cheng 6dc73297c3 MEMSET / MEMCPY lowering bugs: we can't issue a single WORD / DWORD version of
rep/stos and rep/mov if the count is not a constant. We could do
  rep/stosl; and $count, 3; rep/stosb
For now, I will lower them to memset / memcpy calls. We will revisit this after
a little bit experiment.

Also need to take care of the trailing bytes even if the count is a constant.
Since the max. number of trailing bytes are 3, we will simply issue loads /
stores.

llvm-svn: 26517
2006-03-04 02:48:56 +00:00
Chris Lattner 071faf25e0 Be more conservative with our symbolic alias analysis. In particular,
don't assume that A[1][0] and A[0][i] can't alias.  "i" might be out of
range, or even negative.  This fixes a miscompilation of 188.ammp (which
does bad pointer tricks) with the new CFE.

Testcase here: Analysis/BasicAA/2006-03-03-BadArraySubscript.ll

llvm-svn: 26515
2006-03-04 02:06:34 +00:00
Chris Lattner e43e5c0697 add a note
llvm-svn: 26513
2006-03-04 01:19:34 +00:00
Evan Cheng 084a102b17 Typo
llvm-svn: 26512
2006-03-04 01:12:00 +00:00
Jim Laskey c44f05d624 Added support for dwarf block data entries.
llvm-svn: 26509
2006-03-03 21:00:14 +00:00
Chris Lattner c2de4f3dc1 Unbreak autouprade of llvm.sqrt, simplify some code.
llvm-svn: 26506
2006-03-03 16:31:22 +00:00
Jim Laskey 88f0fe15a2 Adding basic structure support.
llvm-svn: 26505
2006-03-03 15:06:57 +00:00
Evan Cheng 3bf916ddd9 Add more vector NodeTypes: VSDIV, VUDIV, VAND, VOR, and VXOR.
llvm-svn: 26504
2006-03-03 07:01:07 +00:00
Evan Cheng a7fb285c60 Number of NodeTypes now exceeds 128.
llvm-svn: 26503
2006-03-03 06:58:59 +00:00
Evan Cheng 23e75f5b49 SDOperand::isOperand should not be a forwarding. It must check *this against N's operands.
llvm-svn: 26502
2006-03-03 06:42:32 +00:00
Evan Cheng 6b08ae8497 Added isOperand(N): true if this is an operand of N
llvm-svn: 26501
2006-03-03 06:24:54 +00:00
Evan Cheng 5e9a695026 A bit more tweaking
llvm-svn: 26500
2006-03-03 06:23:43 +00:00
Jeff Cohen 55c1173a6c Fix VC++ compilation errors.
llvm-svn: 26498
2006-03-03 03:25:07 +00:00
Evan Cheng 993e9cf26e Move #include "llvm/CodeGen/AsmPrinter.h" to top since it's the interface.
llvm-svn: 26493
2006-03-03 02:04:29 +00:00
Chris Lattner b203355298 Split the valuetypes out of Target.td into ValueTypes.td
llvm-svn: 26490
2006-03-03 01:55:26 +00:00
Chris Lattner 681ef2f083 Change this to work with renamed intrinsics.
llvm-svn: 26484
2006-03-03 01:34:17 +00:00
Chris Lattner ea7986aeca Make this work with renamed intrinsics.
llvm-svn: 26482
2006-03-03 01:30:23 +00:00
Chris Lattner bce2626d8a updates for recent changes
llvm-svn: 26481
2006-03-03 01:21:36 +00:00
Chris Lattner ad3c974a77 remove the read/write port/io intrinsics.
llvm-svn: 26479
2006-03-03 00:19:58 +00:00
Chris Lattner 093c159efb Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709, and paving the way for future progress.

llvm-svn: 26476
2006-03-03 00:00:25 +00:00