[AArch64, ARM] Enable GlobalMerge with -O3 rather than -O1.
The pass used to be enabled by default with CodeGenOpt::Less (-O1).
This is too aggressive, considering the pass indiscriminately merges
all globals together.
Currently, performance doesn't always improve, and, on code that uses
few globals (e.g., the odd file- or function- static), more often than
not is degraded by the optimization. Lengthy discussion can be found
on llvmdev (AArch64-focused; ARM has similar problems):
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-February/082800.html
Also, it makes tooling and debuggers less useful when dealing with
globals and data sections.
GlobalMerge needs to better identify those cases that benefit, and this
will be done separately. In the meantime, move the pass to run with
-O3 rather than -O1, on both ARM and AArch64.
llvm-svn: 233024
2015-03-24 05:17:36 +08:00
|
|
|
; RUN: llc %s -mtriple=aarch64-none-linux-gnu -O3 -enable-global-merge -o - | FileCheck %s
|
|
|
|
; RUN: llc %s -mtriple=aarch64-none-linux-gnu -O3 -enable-global-merge -global-merge-on-external -o - | FileCheck %s
|
2014-06-14 06:57:59 +08:00
|
|
|
|
[AArch64, ARM] Enable GlobalMerge with -O3 rather than -O1.
The pass used to be enabled by default with CodeGenOpt::Less (-O1).
This is too aggressive, considering the pass indiscriminately merges
all globals together.
Currently, performance doesn't always improve, and, on code that uses
few globals (e.g., the odd file- or function- static), more often than
not is degraded by the optimization. Lengthy discussion can be found
on llvmdev (AArch64-focused; ARM has similar problems):
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-February/082800.html
Also, it makes tooling and debuggers less useful when dealing with
globals and data sections.
GlobalMerge needs to better identify those cases that benefit, and this
will be done separately. In the meantime, move the pass to run with
-O3 rather than -O1, on both ARM and AArch64.
llvm-svn: 233024
2015-03-24 05:17:36 +08:00
|
|
|
; RUN: llc %s -mtriple=aarch64-linux-gnuabi -O3 -enable-global-merge -o - | FileCheck %s
|
|
|
|
; RUN: llc %s -mtriple=aarch64-linux-gnuabi -O3 -enable-global-merge -global-merge-on-external -o - | FileCheck %s
|
2014-06-14 06:57:59 +08:00
|
|
|
|
[AArch64, ARM] Enable GlobalMerge with -O3 rather than -O1.
The pass used to be enabled by default with CodeGenOpt::Less (-O1).
This is too aggressive, considering the pass indiscriminately merges
all globals together.
Currently, performance doesn't always improve, and, on code that uses
few globals (e.g., the odd file- or function- static), more often than
not is degraded by the optimization. Lengthy discussion can be found
on llvmdev (AArch64-focused; ARM has similar problems):
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-February/082800.html
Also, it makes tooling and debuggers less useful when dealing with
globals and data sections.
GlobalMerge needs to better identify those cases that benefit, and this
will be done separately. In the meantime, move the pass to run with
-O3 rather than -O1, on both ARM and AArch64.
llvm-svn: 233024
2015-03-24 05:17:36 +08:00
|
|
|
; RUN: llc %s -mtriple=aarch64-apple-ios -O3 -enable-global-merge -o - | FileCheck %s --check-prefix=CHECK-APPLE-IOS
|
|
|
|
; RUN: llc %s -mtriple=aarch64-apple-ios -O3 -enable-global-merge -global-merge-on-external -o - | FileCheck %s --check-prefix=CHECK-APPLE-IOS
|
2014-06-14 06:57:59 +08:00
|
|
|
|
|
|
|
@m = internal global i32 0, align 4
|
|
|
|
@n = internal global i32 0, align 4
|
|
|
|
|
|
|
|
define void @f1(i32 %a1, i32 %a2) {
|
2014-12-03 07:53:43 +08:00
|
|
|
;CHECK-APPLE-IOS-NOT: adrp
|
2014-06-14 06:57:59 +08:00
|
|
|
;CHECK-APPLE-IOS: adrp x8, __MergedGlobals@PAGE
|
|
|
|
;CHECK-APPLE-IOS-NOT: adrp
|
|
|
|
;CHECK-APPLE-IOS: add x8, x8, __MergedGlobals@PAGEOFF
|
|
|
|
store i32 %a1, i32* @m, align 4
|
|
|
|
store i32 %a2, i32* @n, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
;CHECK: .type _MergedGlobals,@object // @_MergedGlobals
|
|
|
|
;CHECK: .local _MergedGlobals
|
|
|
|
;CHECK: .comm _MergedGlobals,8,8
|
|
|
|
|
|
|
|
;CHECK-APPLE-IOS: .zerofill __DATA,__bss,__MergedGlobals,8,3 ; @_MergedGlobals
|