1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

14630 Commits

Author SHA1 Message Date
Chris Lattner
816a8a5e1e Temporarily disable a buggy transformation until it can be fixed. This fixes
254.gap.

llvm-svn: 16853
2004-10-08 19:15:44 +00:00
Misha Brukman
d858079005 Adjust paths due to moving InstrSched to lib/Target/SparcV9
llvm-svn: 16852
2004-10-08 18:30:22 +00:00
Misha Brukman
85ca837989 Use the SparcV9-marked instr scheduling library
llvm-svn: 16851
2004-10-08 18:14:56 +00:00
Misha Brukman
a01e5cd2ea InstrSched has been moved to lib/Target/SparcV9
llvm-svn: 16850
2004-10-08 18:12:53 +00:00
Misha Brukman
049f559995 InstrSched is SparcV9-specific and so has been moved to lib/Target/SparcV9/
llvm-svn: 16849
2004-10-08 18:12:14 +00:00
Misha Brukman
b1851ac70c Single-space instead of double-spacing in the Makefile
llvm-svn: 16848
2004-10-08 18:11:14 +00:00
Misha Brukman
cfe86b257b Build InstrSched as well, and all three subdirs can be built independently
llvm-svn: 16847
2004-10-08 18:10:48 +00:00
Misha Brukman
5ea7613a13 Single-space instead of double-spacing in the Makefile
llvm-svn: 16845
2004-10-08 18:05:25 +00:00
Reid Spencer
edbe8cdaec Remove unused variable.
llvm-svn: 16844
2004-10-08 18:01:31 +00:00
Reid Spencer
fd0d9e2637 Make it so that positional parameters can have spaces in them.
llvm-svn: 16843
2004-10-08 17:59:29 +00:00
Chris Lattner
71aecc5006 Implement SRA for global variables. This allows the other global variable
optimizations to trigger much more often.  This allows the elimination of
several dozen more global variables in Programs/External.  Note that we only
do this for non-constant globals: constant globals will already be optimized
out if the accesses to them permit it.

This implements Transforms/GlobalOpt/globalsra.llx

llvm-svn: 16842
2004-10-08 17:32:09 +00:00
Chris Lattner
feb9fb9929 New testcase
llvm-svn: 16841
2004-10-08 17:29:47 +00:00
Chris Lattner
1ac1e54bf9 Fix bug: 2004-10-08-SelectSetCCFold.llx. Normally this is hidden by the
instcombine xform, which is why we didn't notice it before.

llvm-svn: 16840
2004-10-08 16:34:13 +00:00
Chris Lattner
0a1bfd5be0 New testcase. The setcc is only used by a select, but not as a condition:
it cannot be folded in.

llvm-svn: 16839
2004-10-08 16:33:40 +00:00
Misha Brukman
7fee34176a Properly `quote' names, and don't forget to add the ending quote!
llvm-svn: 16838
2004-10-08 14:59:05 +00:00
Reid Spencer
2457302d96 Add the --with-automake option to AutoRegen.sh and provide the automake
version of the configure script. This is an early commit of the automake
support so that automake support can be tested on multiple platforms. Many
additional Makefile.am need to be added to LLVM before this is of any use.
Please wait until automake support is announced on llvmdev list before
using the --with-automake option.

llvm-svn: 16837
2004-10-08 05:33:35 +00:00
Chris Lattner
5839d93b51 Instcombine (X & FF00) + xx00 -> (X+xx00) & FF00, implementing and.ll:test27
This comes up when doing adds to bitfield elements.

llvm-svn: 16836
2004-10-08 05:07:56 +00:00
Chris Lattner
a50e67b63a New testcase
llvm-svn: 16835
2004-10-08 05:03:25 +00:00
Chris Lattner
87259c3ce9 Little patch to turn (shl (add X, 123), 4) -> (add (shl X, 4), 123 << 4)
This triggers in cases of bitfield additions, opening opportunities for
future improvements.

llvm-svn: 16834
2004-10-08 03:46:20 +00:00
Chris Lattner
0220a5fb52 New testcase
llvm-svn: 16833
2004-10-08 03:41:59 +00:00
Nate Begeman
dfefd2f3fc Implement logical and with an immediate that consists of a contiguous block
of one or more 1 bits (may wrap from least significant bit to most
significant bit) as the rlwinm rather than andi., andis., or some longer
instructons sequence.

int andn4(int z) { return z & -4; }
int clearhi(int z) { return z & 0x0000FFFF; }
int clearlo(int z) { return z & 0xFFFF0000; }
int clearmid(int z) { return z & 0x00FFFF00; }
int clearwrap(int z) { return z & 0xFF0000FF; }

_andn4:
        rlwinm r3, r3, 0, 0, 29
        blr

_clearhi:
        rlwinm r3, r3, 0, 16, 31
        blr

_clearlo:
        rlwinm r3, r3, 0, 0, 15
        blr

_clearmid:
        rlwinm r3, r3, 0, 8, 23
        blr

_clearwrap:
        rlwinm r3, r3, 0, 24, 7
        blr

llvm-svn: 16832
2004-10-08 02:49:24 +00:00
Misha Brukman
eb2d1b952b Fix usage description typo
llvm-svn: 16831
2004-10-08 01:11:15 +00:00
Misha Brukman
dab56b7775 Make comment header span the entire line
llvm-svn: 16830
2004-10-08 01:10:52 +00:00
Misha Brukman
0e64e4dad9 Describe how to configure tests to work with f2c
llvm-svn: 16829
2004-10-08 00:55:43 +00:00
Misha Brukman
ea22ed054b * Reformat to fit 80 cols
* Add missing <li> tags

llvm-svn: 16828
2004-10-08 00:41:27 +00:00
Nate Begeman
370b1b7a9a Several fixes and enhancements to the PPC32 backend.
1. Fix an illegal argument to getClassB when deciding whether or not to
   sign extend a byte load.

2. Initial addition of isLoad and isStore flags to the instruction .td file
   for eventual use in a scheduler.

3. Rewrite of how constants are handled in emitSimpleBinaryOperation so
   that we can emit the PowerPC shifted immediate instructions far more
   often.  This allows us to emit the following code:

int foo(int x) { return x | 0x00F0000; }

_foo:
.LBB_foo_0:     ; entry
        ; IMPLICIT_DEF
        oris r3, r3, 15
        blr

llvm-svn: 16826
2004-10-07 22:30:03 +00:00
Nate Begeman
76d2a77998 Add ori reg, reg, 0 as a move instruction. This can be generated from
loading a 32bit constant into a register whose low halfword is all zeroes.

We now omit the ori after the lis for the following C code:

int bar(int y) { return y * 0x00F0000; }

_bar:
.LBB_bar_0:     ; entry
        ; IMPLICIT_DEF
        lis r2, 15
        mullw r3, r3, r2
        blr

llvm-svn: 16825
2004-10-07 22:26:12 +00:00
Nate Begeman
f60feea650 Remove unnecessary header include
llvm-svn: 16824
2004-10-07 22:24:32 +00:00
Chris Lattner
7882b54197 Improve comments, no functionality changes
llvm-svn: 16814
2004-10-07 21:30:30 +00:00
Chris Lattner
d15e144241 Fix a nasty dangling pointer problem, due to a free'd pointer being left in
a map.  This caused problems if a later object happened to be allocated at
the free'd object's address.

llvm-svn: 16813
2004-10-07 20:01:31 +00:00
Chris Lattner
36e1648743 Get friendly with Type
llvm-svn: 16812
2004-10-07 19:21:43 +00:00
Chris Lattner
50e55bcdb0 Unfortunately the fix for the previous bug introduced the previous
exponential behavior (bork!).  This patch processes stuff with an
explicit SCC finder, allowing the algorithm to be more clear,
efficient, and also (as a bonus) correct!  This gets us back to taking
0.6s to disassemble my horrible .bc file that previously took something
> 30 mins.

llvm-svn: 16811
2004-10-07 19:20:48 +00:00
Chris Lattner
4b6b21a216 Change signature of this method again
llvm-svn: 16810
2004-10-07 19:19:12 +00:00
Chris Lattner
d54fd7bc63 These files now live in Transforms/GlobalOpt
llvm-svn: 16809
2004-10-07 19:16:43 +00:00
Chris Lattner
e272693894 Move these files from Transforms/GlobalConstifier
llvm-svn: 16808
2004-10-07 19:16:26 +00:00
Chris Lattner
dfdbd62d37 Fix a bug in my previous change. Unfortunately this reverts most of the
speedup, but has the advantage of not breaking a bunch of programs!

llvm-svn: 16806
2004-10-07 16:19:40 +00:00
Reid Spencer
e53aa77b7a Make these scripts work on SunOS too.
llvm-svn: 16805
2004-10-07 16:03:21 +00:00
Chris Lattner
e1d5d599bd Fix a bug in the safety analysis routine
llvm-svn: 16804
2004-10-07 06:01:25 +00:00
Chris Lattner
e7ec24c63e Comment cleanups
llvm-svn: 16803
2004-10-07 06:00:24 +00:00
Chris Lattner
ad9fe72e72 * Rename pass to globalopt, since we do more than just constify
* Instead of handling dead functions specially, just nuke them.
* Be more aggressive about cleaning up after constification, in
  particular, handle getelementptr instructions and constantexprs.
* Be a little bit more structured about how we process globals.

*** Delete globals that are only stored to, and never read.  These are
    clearly not useful, so they should go.  This implements deadglobal.llx

This last one triggers quite a few times.  In particular, 2208 in the
external tests, 1865 of which are in 252.eon.  This shrinks eon from
1995094 to 1732341 bytes of bytecode.

llvm-svn: 16802
2004-10-07 04:16:33 +00:00
Chris Lattner
8ddca97a5a Rename pass
llvm-svn: 16801
2004-10-07 04:12:02 +00:00
Chris Lattner
fff02e213b This pass is not needed, as there is only ever one global: the stack
llvm-svn: 16800
2004-10-07 04:10:36 +00:00
Chris Lattner
a705773db7 Add new testcase, rename pass
llvm-svn: 16799
2004-10-07 04:07:08 +00:00
Chris Lattner
3a2af6b431 Don't add libz or libbz2 to the USEDLIBS lists, those are for LLVM libraries.
llvm-svn: 16798
2004-10-07 00:03:11 +00:00
Chris Lattner
6211fd3b08 Don't call memset if malloc returns a null pointer
llvm-svn: 16797
2004-10-06 23:08:03 +00:00
Chris Lattner
4a19983f2d Implement GlobalConstifier/trivialstore.llx, and also do some
simplifications of the resultant program to avoid making later passes
do it all.

This allows us to constify globals that just have the same constant that
they are initialized stored into them.

Suprisingly this comes up ALL of the freaking time, dozens of times in
SPEC, 30 times in vortex alone.

For example, on 256.bzip2, it allows us to constify these two globals:

%smallMode = internal global ubyte 0             ; <ubyte*> [#uses=8]
%verbosity = internal global int 0               ; <int*> [#uses=49]

Which (with later optimizations) results in the bytecode file shrinking
from 82286 to 69686 bytes!  Lets hear it for IPO :)

For the record, it's nuking lots of "if (verbosity > 2) { do lots of stuff }"
code.

llvm-svn: 16793
2004-10-06 20:57:02 +00:00
Chris Lattner
c128e52a90 New testcase
llvm-svn: 16791
2004-10-06 20:42:51 +00:00
Chris Lattner
e412d10cc0 Dont' let null nodes sneak past cast instructions
llvm-svn: 16779
2004-10-06 19:29:13 +00:00
Misha Brukman
9ed0f36e93 Undoxyfy internal method.
llvm-svn: 16774
2004-10-06 17:19:58 +00:00
Misha Brukman
80dedeb9fd Doxygen-ify comments
llvm-svn: 16773
2004-10-06 16:56:16 +00:00