llvm-6502/lib/Transforms/IPO
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
..
ArgumentPromotion.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
ConstantMerge.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
DeadArgumentElimination.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
DeadTypeElimination.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
ExtractFunction.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
FunctionResolution.cpp Disable the 'WARNING: Found global types that are not compatible' warning 2004-09-30 00:12:29 +00:00
GlobalDCE.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
GlobalOpt.cpp Eliminate global pointers that are only stored a single value and null if 2004-10-09 21:48:45 +00:00
Inliner.cpp Fix the inliner to always delete any edges from the external call node to 2004-09-18 21:37:03 +00:00
Inliner.h Simplify the interface and remove an unneeded #include 2004-05-23 21:21:35 +00:00
InlineSimple.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
Internalize.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
IPConstantPropagation.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
LoopExtractor.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
LowerSetJmp.cpp Comment cleanups 2004-10-07 06:00:24 +00:00
Makefile Added LLVM copyright notice to Makefiles. 2003-10-20 22:26:57 +00:00
PruneEH.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
RaiseAllocations.cpp 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00