summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-25 06:40:51 +0000
committerChris Lattner <sabre@nondot.org>2007-04-25 06:40:51 +0000
commit827cb98a0a1027b69bcf288503c2577667c4eab6 (patch)
treecc477eb31802c15d877fdb9b52e67d2afbd629c0 /llvm/lib/Support/CommandLine.cpp
parent7ebda6ba378554e39f61440344bf5421fa54a60b (diff)
downloadbcm5719-llvm-827cb98a0a1027b69bcf288503c2577667c4eab6.tar.gz
bcm5719-llvm-827cb98a0a1027b69bcf288503c2577667c4eab6.zip
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 llvm-svn: 36429
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud