mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-16 11:30:51 +00:00
35e8055393
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235249 91177308-0d34-0410-b5e6-96231b3b80d8
13 lines
430 B
LLVM
13 lines
430 B
LLVM
; 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.
|
|
|
|
; CHECK: _MergedGlobals:
|
|
@g1 = internal addrspace(1) global i32 1
|
|
@g2 = internal addrspace(1) global i32 2
|
|
|
|
|
|
; CHECK: _MergedGlobals1:
|
|
@g3 = internal addrspace(2) global i32 3
|
|
@g4 = internal addrspace(2) global i32 4
|