llvm-6502/lib
Chris Lattner 9b34a61019 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16871 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-09 21:48:45 +00:00
..
Analysis Fix a nasty dangling pointer problem, due to a free'd pointer being left in 2004-10-07 20:01:31 +00:00
Archive Changes For Bug 352 2004-09-01 22:55:40 +00:00
AsmParser Add a check to avoid an assertion on malformed input 2004-10-09 02:18:58 +00:00
Bytecode Fix doxygen comment 2004-09-28 16:57:46 +00:00
CodeGen Hyphenate target-(in)dependent for more tasty grammar goodness (tm) 2004-10-08 19:43:31 +00:00
Debugger Changes For Bug 352 2004-09-01 22:55:40 +00:00
ExecutionEngine Convert code to compile with vc7.1. 2004-09-15 17:06:42 +00:00
Linker Make sure the const bit gets inherited correctly when linking declarations 2004-10-05 02:28:11 +00:00
Support Excise the ill-advised RLCOMP compression algorithm and simply leave the 2004-10-04 17:45:44 +00:00
System Must include sys/stat.h before declaring a 'struct stat' 2004-10-05 18:46:59 +00:00
Target Instead of silently breaking, print notification of why this doesn't work. 2004-10-09 21:13:51 +00:00
Transforms Eliminate global pointers that are only stored a single value and null if 2004-10-09 21:48:45 +00:00
VMCore Unfortunately the fix for the previous bug introduced the previous 2004-10-07 19:20:48 +00:00
Makefile Wrap long line 2004-09-15 01:34:42 +00:00