llvm-6502/lib
Chris Lattner 79b3bd395d If an alloca only has two types of uses: 1) reads 2) a memcpy/memmove that
copies from a constant global, then we can change the reads to read from the
global instead of from the alloca.  This eliminates the alloca and the memcpy,
and promotes secondary optimizations (because the loads are now loads from
a constant global).

This is important for a common C idiom:

void foo() {
   int A[] = {1,2,3,4,5,6,7,8,9...};
   ... only reads of A ...
}

For some reason, people forget to mark the array static or const.

This triggers on these multisource benchmarks:
JM/ldecode: block_pos, [3 x [4 x [4 x i32]]]
FreeBench/mason: m, [18 x i32], inlined 4 times
MiBench/office-stringsearch: search_strings, [1332 x i8*]
MiBench/office-stringsearch: find_strings, [1333 x i8*]
Prolangs-C++/city: dirs, [9 x i8*], inlined 4 places

and these spec benchmarks:
177.mesa: message, [8 x [32 x i8]]
186.crafty: bias_rl45, [64 x i32]
186.crafty: diag_sq, [64 x i32]
186.crafty: empty, [9 x i8]
186.crafty: xlate, [15 x i8]
186.crafty: status, [13 x i8]
186.crafty: bdinfo, [25 x i8]
445.gobmk: routines, [16 x i8*]
458.sjeng: piece_rep, [14 x i8*]
458.sjeng: t, [13 x i32], inlined 4 places.
464.h264ref: block8x8_idx, [3 x [4 x [4 x i32]]]
464.h264ref: block_pos, [3 x [4 x [4 x i32]]]
464.h264ref: j_off_tab, [12 x i32]

This implements Transforms/ScalarRepl/memcpy-from-global.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36429 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-25 06:40:51 +00:00
..
Analysis
Archive
AsmParser Regenerated 2007-04-22 20:09:11 +00:00
Bitcode ensure that every error return sets a message (and goes through Error, for 2007-04-24 18:15:21 +00:00
Bytecode fix a memory leak 2007-04-24 17:20:52 +00:00
CodeGen support for >4G stack frames 2007-04-25 04:30:24 +00:00
Debugger
ExecutionEngine
Linker
Support
System Cygwin doesn't have the RSS_LIMIT for get/setrlimit. 2007-04-23 07:22:51 +00:00
Target support for >4G stack frames 2007-04-25 04:30:24 +00:00
Transforms If an alloca only has two types of uses: 1) reads 2) a memcpy/memmove that 2007-04-25 06:40:51 +00:00
VMCore simplify some code 2007-04-25 05:49:09 +00:00
Makefile build the bitcode dir 2007-04-22 06:26:05 +00:00