1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

19898 Commits

Author SHA1 Message Date
Chris Lattner
365774f457 Don't create zero sized stack objects even for array allocas with a zero
number of elements.

llvm-svn: 23219
2005-09-02 18:41:28 +00:00
Chris Lattner
813a73e8e9 Decouple fsqrt from gpul optimizations, implementing fsqrt.ll.
Remove the -enable-gpopt option which is subsumed by feature flags.

llvm-svn: 23218
2005-09-02 18:33:05 +00:00
Chris Lattner
ed22d99214 new testcase to ensure fsqrt is generated for correct subtargets only, and
that the fsqrt feature works.

llvm-svn: 23217
2005-09-02 18:32:22 +00:00
Chris Lattner
49eef12127 Move a bunch of non-deprecated methods above the "deprecated line"
llvm-svn: 23216
2005-09-02 18:16:20 +00:00
Chris Lattner
7d89863a77 Fix the release build, noticed by Eric van Riet Paap
llvm-svn: 23215
2005-09-02 07:09:28 +00:00
Chris Lattner
371f542759 Fix a problem that Dan Berlin noticed, where reassociation would not succeed
in building maximal expressions before simplifying them.  In particular, i
cases like this:

X-(A+B+X)

the code would consider A+B+X to be a maximal expression (not understanding
that the single use '-' would be turned into a + later), simplify it (a noop)
then later get simplified again.

Each of these simplify steps is where the cost of reassociation comes from,
so this patch should speed up the already fast pass a bit.

Thanks to Dan for noticing this!

llvm-svn: 23214
2005-09-02 07:07:58 +00:00
Chris Lattner
4cade5915d Avoid creating garbage instructions, just move the old add instruction
to where we need it when converting -(A+B+C) -> -A + -B + -C.

llvm-svn: 23213
2005-09-02 06:38:04 +00:00
Chris Lattner
019ab1a9ab new testcase for recent bugfix
llvm-svn: 23212
2005-09-02 06:12:12 +00:00
Chris Lattner
dfba6f5029 add some assertions and fix problems where reassociate could access the
Ops vector out of range

llvm-svn: 23211
2005-09-02 05:23:22 +00:00
Jeff Cohen
930e81f03b Fix VC++ build errors
llvm-svn: 23210
2005-09-02 02:51:42 +00:00
Chris Lattner
6f9e01aa94 Restore this patch now that the latent bug has been fixed
llvm-svn: 23209
2005-09-02 01:24:55 +00:00
Chris Lattner
86bed2f90b Make sure to legalize assert[zs]ext's operand correctly
llvm-svn: 23208
2005-09-02 01:15:01 +00:00
Chris Lattner
a58ee78b78 Revert the previous patch which causes a mysterious regression in toast.
llvm-svn: 23207
2005-09-02 00:47:05 +00:00
Chris Lattner
4919477f39 Teach live intervals to not crash on dead livein regs
llvm-svn: 23206
2005-09-02 00:20:32 +00:00
Chris Lattner
8a6c15f4f4 For values that are live across basic blocks and need promotion, use ANY_EXTEND
instead of ZERO_EXTEND to eliminate extraneous extensions.  This eliminates
dead zero extensions on formal arguments and other cases on PPC, implementing
the newly tightened up test/Regression/CodeGen/PowerPC/small-arguments.ll test.

llvm-svn: 23205
2005-09-02 00:19:37 +00:00
Chris Lattner
aae61e684c legalize ANY_EXTEND appropriately
llvm-svn: 23204
2005-09-02 00:18:10 +00:00
Chris Lattner
3f7fbe14a8 Add support for ANY_EXTEND and add a few minor folds for it
llvm-svn: 23203
2005-09-02 00:17:32 +00:00
Chris Lattner
70e3e44ec4 Handle any_extend like zext
llvm-svn: 23202
2005-09-02 00:16:09 +00:00
Chris Lattner
eb4736b128 Handle ANY_EXTEND like ZERO_EXTEND. Simplify the extend/truncate code on
the observation that it only has to handle i1 -> i64 and i64 -> i1.

llvm-svn: 23201
2005-09-02 00:15:30 +00:00
Chris Lattner
a0ac88861d Add a new ANY_EXTEND node, which operates like an extension but has undefined
top bits.

llvm-svn: 23200
2005-09-02 00:14:40 +00:00
Chris Lattner
0af4af9c55 This should permit NOT and's, not even dead ones.
llvm-svn: 23199
2005-09-02 00:13:56 +00:00
Chris Lattner
983190ce4c Implement small-arguments.ll:test3 by teaching the DAG optimizer that
the results of calls to functions returning small values are properly
sign/zero extended.

llvm-svn: 23198
2005-09-01 23:44:32 +00:00
Chris Lattner
3772098053 Another case that shouldn't have sign extends: functions returning short
are known to return properly sign extended values, no need for an explicit
extension.

llvm-svn: 23197
2005-09-01 23:43:58 +00:00
Nate Begeman
626c46f8d9 Fix some code in the current node combining code, spotted when it was moved
over to DAGCombiner.cpp

1. Don't assume that SetCC returns i1 when folding (xor (setcc) constant)
2. Don't duplicate code in folding AND with AssertZext that is handled by
   MaskedValueIsZero

llvm-svn: 23196
2005-09-01 23:25:49 +00:00
Nate Begeman
18f456b8e3 Implement first round of feedback from chris (there's still a couple things
left to do).

llvm-svn: 23195
2005-09-01 23:24:04 +00:00
Chris Lattner
c3981dc548 Align functions to 16-byte boundaries, to eliminate noise in performance measurements. This improves the performance of 'treeadd' by about 20% with the dag
isel, restoring it to the pattern-isel level (which happens to get the alignment right).

llvm-svn: 23194
2005-09-01 23:08:50 +00:00
Chris Lattner
e24ce3bb28 Local labels on darwin apparently start with just 'L', not .L like other
platforms.  This reduces executable size and makes shark realize the actual
bounds of functions instead of showing each MBB as a function :)

llvm-svn: 23193
2005-09-01 21:48:35 +00:00
Jim Laskey
f32ef9a37f 1. Use SubtargetFeatures in llc/lli.
2. Propagate feature "string" to all targets.

3. Implement use of SubtargetFeatures in PowerPCTargetSubtarget.

llvm-svn: 23192
2005-09-01 21:38:21 +00:00
Jim Laskey
09a731071f This new class provides support for platform specific "features". The intent
is to manage processor specific attributes from the command line.  See examples
of use in llc/lli and PowerPCTargetSubtarget.

llvm-svn: 23191
2005-09-01 21:36:18 +00:00
Chris Lattner
b6d26dc675 Implement dynamic allocas correctly. In particular, because we were copying
directly out of R1 (without using a CopyFromReg, which uses a chain), multiple
allocas were getting CSE'd together, producing bogus code.  For this:

int %foo(bool %X, int %A, int %B) {
        br bool %X, label %T, label %F
F:
        %G = alloca int
        %H = alloca int
        store int %A, int* %G
        store int %B, int* %H
        %R = load int* %G
        ret int %R
T:
        ret int 0
}

We were generating:

_foo:
        stwu r1, -16(r1)
        stw r31, 4(r1)
        or r31, r1, r1
        stw r1, 12(r31)
        cmpwi cr0, r3, 0
        bne cr0, .LBB_foo_2     ; T
.LBB_foo_1:     ; F
        li r2, 16
        subf r2, r2, r1   ;; One alloca
        or r1, r2, r2
        or r3, r1, r1
        or r1, r2, r2
        or r2, r1, r1
        stw r4, 0(r3)
        stw r5, 0(r2)
        lwz r3, 0(r3)
        lwz r1, 12(r31)
        lwz r31, 4(r31)
        lwz r1, 0(r1)
        blr
.LBB_foo_2:     ; T
        li r3, 0
        lwz r1, 12(r31)
        lwz r31, 4(r31)
        lwz r1, 0(r1)
        blr

Now we generate:

_foo:
        stwu r1, -16(r1)
        stw r31, 4(r1)
        or r31, r1, r1
        stw r1, 12(r31)
        cmpwi cr0, r3, 0
        bne cr0, .LBB_foo_2     ; T
.LBB_foo_1:     ; F
        or r2, r1, r1
        li r3, 16
        subf r2, r3, r2  ;; Alloca 1
        or r1, r2, r2
        or r2, r1, r1
        or r6, r1, r1
        subf r3, r3, r6  ;; Alloca 2
        or r1, r3, r3
        or r3, r1, r1
        stw r4, 0(r2)
        stw r5, 0(r3)
        lwz r3, 0(r2)
        lwz r1, 12(r31)
        lwz r31, 4(r31)
        lwz r1, 0(r1)
        blr
.LBB_foo_2:     ; T
        li r3, 0
        lwz r1, 12(r31)
        lwz r31, 4(r31)
        lwz r1, 0(r1)
        blr

This fixes Povray and SPASS with the dag isel, the last two failing cases.
Tommorow we will hopefully turn it on by default! :)

llvm-svn: 23190
2005-09-01 21:31:30 +00:00
Chris Lattner
88cc0407e3 Fix a bug where we were useing HA to get the high part, which seems like it
could cause a miscompile.  Fixing this didn't fix the two programs that fail
though.  :(

This also changes the implementation to follow the pattern selector more
closely, causing us to select 0 to li instead of lis.

llvm-svn: 23189
2005-09-01 19:38:28 +00:00
Chris Lattner
0dacf023bf Do not select the operands being passed into SelectCC. IT does this itself
and selecting early prevents folding immediates into the cmpw* instructions

llvm-svn: 23188
2005-09-01 19:20:44 +00:00
Chris Lattner
f2b775d686 It is NDEBUG not _NDEBUG
llvm-svn: 23186
2005-09-01 18:44:10 +00:00
Nate Begeman
517e40a5bb Add the rest of the currently implemented visit routines to the switch
statement in visit().

llvm-svn: 23185
2005-09-01 00:33:32 +00:00
Nate Begeman
be2fa8f86f First pass at the DAG Combiner. It isn't used anywhere yet, but it should
be mostly functional.  It currently has all folds from SelectionDAG.cpp
that do not involve a condition code.

llvm-svn: 23184
2005-09-01 00:19:25 +00:00
Nate Begeman
a1cffceb07 Add regression test for efficient codegen of i32 x i32 -> hi32(i64) as
mulhs.

llvm-svn: 23183
2005-09-01 00:04:03 +00:00
Chris Lattner
ed58907fa3 remove an inappropriate comment
llvm-svn: 23182
2005-08-31 22:49:51 +00:00
Chris Lattner
b8dcea186c If a function has live ins/outs, print them
llvm-svn: 23181
2005-08-31 22:34:59 +00:00
Chris Lattner
914a0dbba1 Move FCTIWZ handling out of the instruction selectors and into legalization,
getting them out of the business of making stack slots.

llvm-svn: 23180
2005-08-31 21:09:52 +00:00
Chris Lattner
ed72c03aa1 Remove dead code
llvm-svn: 23179
2005-08-31 20:25:15 +00:00
Chris Lattner
173c3fb3e5 Move SHL,SHR i64 -> legalizer
llvm-svn: 23178
2005-08-31 20:23:54 +00:00
Chris Lattner
89c78777c0 Remove code that is now dead from the pattern isel.
llvm-svn: 23177
2005-08-31 19:11:36 +00:00
Chris Lattner
353d5c167f lower sra_parts on the dag, implementing it for the dag isel, and exposing
the ops to dag optimization.

llvm-svn: 23176
2005-08-31 19:09:57 +00:00
Chris Lattner
fc612f96ec Allow targets to custom expand shifts that are too large for their registers
llvm-svn: 23173
2005-08-31 19:01:53 +00:00
Chris Lattner
57412f06ac Add a testcase for nate's patch
llvm-svn: 23172
2005-08-31 18:19:50 +00:00
Chris Lattner
eef2e52921 add assert zext/sext to the dag isel
llvm-svn: 23171
2005-08-31 18:08:46 +00:00
Chris Lattner
2d4180badc Handle AssertSext/AssertZext nodes, fixing the regressions last night.
llvm-svn: 23170
2005-08-31 17:48:04 +00:00
Jeff Cohen
8c454a3024 Fix VC++ precedence warnings
llvm-svn: 23169
2005-08-31 02:47:06 +00:00
Nate Begeman
c28c33f5a4 Enable generation of AssertSext and AssertZext in the PPC backend.
llvm-svn: 23168
2005-08-31 01:58:39 +00:00
Chris Lattner
3d6bf9e384 Fix 'ret long' to return the high and lo parts in the right registers. This
fixes crafty and probably others.

llvm-svn: 23167
2005-08-31 01:34:29 +00:00