Commit Graph

23277 Commits

Author SHA1 Message Date
Jim Laskey e1421afc72 Remove the use of llvm.dbg.declare.
llvm-svn: 26744
2006-03-14 01:53:11 +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 8991ad386d Added getTargetLowering() - returns DAG lowering info.
llvm-svn: 26739
2006-03-13 23:17:42 +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 fea17a9901 emit a mapping from LLVM intrinsic -> GCC builtins.
llvm-svn: 26736
2006-03-13 23:08:44 +00:00
Chris Lattner 5b6ec4a5ea Verify that packed type operands have the right size and base type.
llvm-svn: 26735
2006-03-13 22:38:57 +00:00
Chris Lattner 4a48ee87b7 Add a first ppc altivec intrinsic. Add packed type support.
llvm-svn: 26734
2006-03-13 22:38:32 +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
Evan Cheng 08b0747be9 Optimizing to calloc() to malloc() + memset() can be bad on some platforms.
llvm-svn: 26732
2006-03-13 21:22:43 +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 9f02a3f456 new testcase
llvm-svn: 26726
2006-03-13 06:50:47 +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 4b610e1a42 Mark llvm.stacksave as only reading memory, this fixes
Regression/Transforms/InstCombine/stacksaverestore.ll

llvm-svn: 26715
2006-03-12 00:04:28 +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
Chris Lattner 69035f00e3 fix pasto in generate assertion msg
llvm-svn: 26706
2006-03-11 00:20:47 +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 232d10ec19 remove ShouldEmitDebugFunctions, a hack to support llvm-db via the jit
llvm-svn: 26702
2006-03-10 22:49:05 +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 22d1d651ea Simplify this testcase
llvm-svn: 26699
2006-03-10 22:32:18 +00:00
Chris Lattner 35ac761341 reorder these to make it work with static libraries
llvm-svn: 26698
2006-03-10 21:01:34 +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 0e1d43d1b7 Fix another broken intrinsic.
llvm-svn: 26696
2006-03-10 18:01:03 +00:00
Chris Lattner 0a171d33ca weak globals on darwin require an extra load, breaking this test
llvm-svn: 26695
2006-03-10 17:55:10 +00:00