Commit Graph

14655 Commits

Author SHA1 Message Date
Chris Lattner 604ed7aae8 Fix 2004-10-10-CastStoreOnce.llx, by adjusting types back if we strip off a cast
llvm-svn: 16878
2004-10-10 17:07:12 +00:00
Chris Lattner 89e0b39fe5 New testcase that crashes -globalopt. I found this through inspection, not
actually in the wild :)

llvm-svn: 16877
2004-10-10 17:06:09 +00:00
Chris Lattner a0e769cc81 Implement GlobalOpt/deadglobal-2.llx, deletion of globals that are only
stored to, but are stored at variable indexes.  This occurs at least in
176.gcc, but probably others, and we should handle it for completeness.

llvm-svn: 16876
2004-10-10 16:47:33 +00:00
Chris Lattner 924ce79136 New testcase we were not handling before.
llvm-svn: 16875
2004-10-10 16:46:48 +00:00
Chris Lattner cb9f152d8c Avoid calling use_size() which could (in theory) be expensive if the global
has a large number of users.  Instead, just keep track of whether we're
making changes as we do so.

This patch has no functionlity changes.

llvm-svn: 16874
2004-10-10 16:43:46 +00:00
Chris Lattner 3acdb7fa1b bling bling!
llvm-svn: 16873
2004-10-10 16:26:13 +00:00
Chris Lattner ed8d767883 A testcase that globalopt now handles
llvm-svn: 16872
2004-10-09 21:50:05 +00:00
Chris Lattner 09a527290d Eliminate global pointers that are only stored a single value and null if
we know that all uses of the global will trap if the pointer contained is
null.  In this case, we forward substitute the stored value to any uses.

This has the effect of devirtualizing trivial globals in trivial cases.  For
example, 164.gzip contains this:

gzip.h:extern   int (*read_buf) OF((char *buf, unsigned size));
bits.c: read_buf  = file_read;
deflate.c:    lookahead = read_buf((char*)window,
deflate.c:        n = read_buf((char*)window+strstart+lookahead, more);

Since read_buf has to point to file_read at every use, we just replace
the calls through read_buf with a direct call to file_read.

This occurs in several benchmarks, including 176.gcc and 164.gzip.  Direct
calls are good and stuff.

llvm-svn: 16871
2004-10-09 21:48:45 +00:00
Chris Lattner f9ae6db749 Instead of silently breaking, print notification of why this doesn't work.
llvm-svn: 16870
2004-10-09 21:13:51 +00:00
Chris Lattner b84e1c527f Fix grammaro
llvm-svn: 16869
2004-10-09 19:37:02 +00:00
Chris Lattner 5c91c8f18b Use DEBUG instead of DebugFlag directly, as DebugFlag does not respect
-debug-only!

llvm-svn: 16868
2004-10-09 19:30:36 +00:00
Chris Lattner 99e4111d33 It looks like we're not releasing 1.4 with llvm.org as the official domain
llvm-svn: 16867
2004-10-09 19:19:57 +00:00
Brian Gaeke 74584cd842 update according to tonight's info
llvm-svn: 16866
2004-10-09 05:58:27 +00:00
Brian Gaeke 9c0710781d Implement getModuleMatchQuality and getJITMatchQuality so that v8 will be the
default 32/BE target on sparc hosts, and ppc will continue to be the default
on other hosts.

llvm-svn: 16865
2004-10-09 05:57:01 +00:00
Chris Lattner f369b38d55 Fix infinite loop due to iteration
llvm-svn: 16864
2004-10-09 03:32:52 +00:00
Chris Lattner 4ad08352b4 Implement sub.ll:test17, -X/C -> X/-C
llvm-svn: 16863
2004-10-09 02:50:40 +00:00
Chris Lattner cdc19d6a0e New testcase
llvm-svn: 16862
2004-10-09 02:50:01 +00:00
Chris Lattner 1f4739cd08 Add a check to avoid an assertion on malformed input
llvm-svn: 16861
2004-10-09 02:18:58 +00:00
Chris Lattner 23c8d0b65a The person who was planning to add SSE support isn't anymore, so disable
the -sse* options (to avoid misleading people).

Also, the stack alignment of the target doesn't depend on whether SSE is
eventually implemented, so remove a comment.

llvm-svn: 16860
2004-10-08 22:41:46 +00:00
Chris Lattner 97ea4206f7 Fix a major regression from the bugfix for 2004-10-08-SelectSetCCFold.llx,
which prevented setcc's from being folded into branches.  It appears that
conditional branchinst's CC operand is actually operand(2), not operand(0)
as we might expect. :(

llvm-svn: 16859
2004-10-08 22:24:31 +00:00
Chris Lattner 1b8d2957d3 If we found a dead global, we should at least delete it...
llvm-svn: 16858
2004-10-08 22:05:31 +00:00
Chris Lattner 1c4bddc50d * Pull out the meat of runOnModule into another function for clarity.
* Do not lead dangling dead constants prevent optimization
* Iterate global optimization while we're making progress.

These changes allow us to be more aggressive, handling cases like
GlobalOpt/iterate.llx without a problem (turning it into 'ret int 0').

llvm-svn: 16857
2004-10-08 20:59:28 +00:00
Chris Lattner 8f9a697431 New testcase
llvm-svn: 16856
2004-10-08 20:57:46 +00:00
Chris Lattner 73ad73e2d8 We might as well delete the known-dead global sooner rather than later since
we know it is dead.

llvm-svn: 16855
2004-10-08 20:25:55 +00:00
Misha Brukman 84e5ff7605 Hyphenate target-(in)dependent for more tasty grammar goodness (tm)
llvm-svn: 16854
2004-10-08 19:43:31 +00:00
Chris Lattner 0b41e861b6 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 e4e1360eab Adjust paths due to moving InstrSched to lib/Target/SparcV9
llvm-svn: 16852
2004-10-08 18:30:22 +00:00
Misha Brukman 70da50f095 Use the SparcV9-marked instr scheduling library
llvm-svn: 16851
2004-10-08 18:14:56 +00:00
Misha Brukman cb54d5dfae InstrSched has been moved to lib/Target/SparcV9
llvm-svn: 16850
2004-10-08 18:12:53 +00:00
Misha Brukman 24eb38af7c 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 5a9976ac29 Single-space instead of double-spacing in the Makefile
llvm-svn: 16848
2004-10-08 18:11:14 +00:00
Misha Brukman e75c26687c 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 73dce3a6bf Single-space instead of double-spacing in the Makefile
llvm-svn: 16845
2004-10-08 18:05:25 +00:00
Reid Spencer d90857e144 Remove unused variable.
llvm-svn: 16844
2004-10-08 18:01:31 +00:00
Reid Spencer 6b9ba4a980 Make it so that positional parameters can have spaces in them.
llvm-svn: 16843
2004-10-08 17:59:29 +00:00
Chris Lattner abab0719af 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 6935f560a5 New testcase
llvm-svn: 16841
2004-10-08 17:29:47 +00:00
Chris Lattner 0be2f50401 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 fc95027b7a 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 41f9f29996 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 f9fdfa7aa5 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 bff91d9a2e 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 9467062bcf New testcase
llvm-svn: 16835
2004-10-08 05:03:25 +00:00
Chris Lattner 44bd392cbf 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 7bfe4032fc New testcase
llvm-svn: 16833
2004-10-08 03:41:59 +00:00
Nate Begeman b58dd6799f 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 3e0a20ebb8 Fix usage description typo
llvm-svn: 16831
2004-10-08 01:11:15 +00:00
Misha Brukman f5a92bda7b Make comment header span the entire line
llvm-svn: 16830
2004-10-08 01:10:52 +00:00
Misha Brukman ed3dc439e1 Describe how to configure tests to work with f2c
llvm-svn: 16829
2004-10-08 00:55:43 +00:00
Misha Brukman 8d08d36199 * Reformat to fit 80 cols
* Add missing <li> tags

llvm-svn: 16828
2004-10-08 00:41:27 +00:00