1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -riscv-force-enable-global-merge-external-globals \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s -check-prefix=RV32
4 ; RUN: llc -mtriple=riscv32 -global-merge-min-data-size=5 \
5 ; RUN: -riscv-force-enable-global-merge-external-globals -verify-machineinstrs < %s | FileCheck %s -check-prefix=RV32-MINSIZE
7 @ig1 = internal global i32 0, align 4
8 @ig2 = internal global i32 0, align 4
10 @eg1 = dso_local global i32 0, align 4
11 @eg2 = dso_local global i32 0, align 4
13 define void @f1(i32 %a) nounwind {
16 ; RV32-NEXT: lui a1, %hi(.L_MergedGlobals)
17 ; RV32-NEXT: sw a0, %lo(.L_MergedGlobals)(a1)
18 ; RV32-NEXT: addi a1, a1, %lo(.L_MergedGlobals)
19 ; RV32-NEXT: sw a0, 4(a1)
20 ; RV32-NEXT: sw a0, 8(a1)
21 ; RV32-NEXT: sw a0, 12(a1)
24 ; RV32-MINSIZE-LABEL: f1:
25 ; RV32-MINSIZE: # %bb.0:
26 ; RV32-MINSIZE-NEXT: lui a1, %hi(ig1)
27 ; RV32-MINSIZE-NEXT: sw a0, %lo(ig1)(a1)
28 ; RV32-MINSIZE-NEXT: lui a1, %hi(ig2)
29 ; RV32-MINSIZE-NEXT: sw a0, %lo(ig2)(a1)
30 ; RV32-MINSIZE-NEXT: lui a1, %hi(eg1)
31 ; RV32-MINSIZE-NEXT: sw a0, %lo(eg1)(a1)
32 ; RV32-MINSIZE-NEXT: lui a1, %hi(eg2)
33 ; RV32-MINSIZE-NEXT: sw a0, %lo(eg2)(a1)
34 ; RV32-MINSIZE-NEXT: ret
35 store i32 %a, ptr @ig1, align 4
36 store i32 %a, ptr @ig2, align 4
37 store i32 %a, ptr @eg1, align 4
38 store i32 %a, ptr @eg2, align 4