diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-04-18 01:21:58 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-04-18 01:21:58 +0000 |
commit | 279e3ee954fd41164fd78e4f20ea54a3c53cc5c8 (patch) | |
tree | ec1973be7ffd124e68efe912e301c3f3f4f66772 /llvm/test/CodeGen/ARM | |
parent | 7c60f20e497c10e506a44317aa98ba23f8b04b54 (diff) | |
download | bcm5719-llvm-279e3ee954fd41164fd78e4f20ea54a3c53cc5c8.tar.gz bcm5719-llvm-279e3ee954fd41164fd78e4f20ea54a3c53cc5c8.zip |
[GlobalMerge] Look at uses to create smaller global sets.
Instead of merging everything together, look at the users of
GlobalVariables, and try to group them by function, to create
sets of globals used "together".
Using that information, a less-aggressive alternative is to keep merging
everything together *except* globals that are only ever used alone, that
is, those for which it's clearly non-profitable to merge with others.
In my testing, grouping by Function is too aggressive, but grouping by
BasicBlock is too conservative. Anything in-between isn't trivially
available, so stick with Function grouping for now.
cl::opts are added for testing; both enabled by default.
A few of the testcases aren't testing the merging proper, but just
various edge cases when merging does occur. Update them to use the
previous grouping behavior. Also, one of the tests is unrelated to
GlobalMerge; change it accordingly.
While there, switch to r234666' flags rather than the brutal -O3.
Differential Revision: http://reviews.llvm.org/D8070
llvm-svn: 235249
Diffstat (limited to 'llvm/test/CodeGen/ARM')
-rw-r--r-- | llvm/test/CodeGen/ARM/2010-12-15-elf-lcomm.ll | 6 | ||||
-rw-r--r-- | llvm/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/ARM/2011-06-29-MergeGlobalsAlign.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/ARM/global-merge-addrspace.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/ARM/global-merge.ll | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/llvm/test/CodeGen/ARM/2010-12-15-elf-lcomm.ll b/llvm/test/CodeGen/ARM/2010-12-15-elf-lcomm.ll index cb91890a9fd..f04e053b2e0 100644 --- a/llvm/test/CodeGen/ARM/2010-12-15-elf-lcomm.ll +++ b/llvm/test/CodeGen/ARM/2010-12-15-elf-lcomm.ll @@ -1,6 +1,6 @@ -; RUN: llc %s -mtriple=armv7-linux-gnueabi -O3 -filetype=obj -o - | \ +; RUN: llc %s -mtriple=armv7-linux-gnueabi -filetype=obj -o - | \ ; RUN: llvm-readobj -s -t | FileCheck -check-prefix=OBJ %s -; RUN: llc %s -mtriple=armv7-linux-gnueabi -O3 -o - | \ +; RUN: llc %s -mtriple=armv7-linux-gnueabi -o - | \ ; RUN: FileCheck -check-prefix=ASM %s @@ -12,7 +12,7 @@ ; ASM: .type array00,%object @ @array00 ; ASM-NEXT: .local array00 ; ASM-NEXT: .comm array00,80,1 -; ASM-NEXT: .type _MergedGlobals,%object @ @_MergedGlobals +; ASM-NEXT: .type sum,%object @ @sum ; OBJ: Symbols [ diff --git a/llvm/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll b/llvm/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll index 7196d2d37bd..b490d329a44 100644 --- a/llvm/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll +++ b/llvm/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll @@ -1,4 +1,4 @@ -; RUN: llc -O3 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; RUN: llc -arm-global-merge -global-merge-group-by-use=false -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32" target triple = "thumbv7-apple-darwin10" diff --git a/llvm/test/CodeGen/ARM/2011-06-29-MergeGlobalsAlign.ll b/llvm/test/CodeGen/ARM/2011-06-29-MergeGlobalsAlign.ll index 236dc1c0dbc..aac8f7b3a02 100644 --- a/llvm/test/CodeGen/ARM/2011-06-29-MergeGlobalsAlign.ll +++ b/llvm/test/CodeGen/ARM/2011-06-29-MergeGlobalsAlign.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 -O3 | FileCheck %s +; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 -arm-global-merge -global-merge-group-by-use=false | FileCheck %s ; CHECK: .zerofill __DATA,__bss,__MergedGlobals,16,2 @prev = external global [0 x i16] diff --git a/llvm/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll b/llvm/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll index 1614e8d0c67..37f6b69e762 100644 --- a/llvm/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll +++ b/llvm/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll @@ -1,4 +1,4 @@ -; RUN: llc -O3 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; RUN: llc -arm-global-merge -global-merge-group-by-use=false -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s ; Check debug info output for merged global. ; DW_AT_location diff --git a/llvm/test/CodeGen/ARM/global-merge-addrspace.ll b/llvm/test/CodeGen/ARM/global-merge-addrspace.ll index 7b71e89bbe7..73a3afb7e4e 100644 --- a/llvm/test/CodeGen/ARM/global-merge-addrspace.ll +++ b/llvm/test/CodeGen/ARM/global-merge-addrspace.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=thumb-apple-darwin -O3 | FileCheck %s +; RUN: llc < %s -mtriple=thumb-apple-darwin -arm-global-merge -global-merge-group-by-use=false | FileCheck %s ; Test the GlobalMerge pass. Check that the pass does not crash when using ; multiple address spaces. diff --git a/llvm/test/CodeGen/ARM/global-merge.ll b/llvm/test/CodeGen/ARM/global-merge.ll index d535ea7c0ce..22bbe87784e 100644 --- a/llvm/test/CodeGen/ARM/global-merge.ll +++ b/llvm/test/CodeGen/ARM/global-merge.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=thumb-apple-darwin -O3 -global-merge-on-const=true | FileCheck %s +; RUN: llc < %s -mtriple=thumb-apple-darwin -arm-global-merge -global-merge-group-by-use=false -global-merge-on-const=true | FileCheck %s ; Test the ARMGlobalMerge pass. Use -march=thumb because it has a small ; value for the maximum offset (127). |