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=SMALL-DATA
4 ; RUN: llc -mtriple=riscv64 -global-merge-min-data-size=5 \
5 ; RUN: -riscv-force-enable-global-merge-external-globals -verify-machineinstrs < %s \
6 ; RUN: | FileCheck %s -check-prefix=MINSIZE
8 @ig1 = internal global i32 0, align 4
9 @ig2 = internal global i32 0, align 4
11 @eg1 = dso_local global i32 0, align 4
12 @eg2 = dso_local global i32 0, align 4
15 ; This test shows that GlobalDataMinSize is set to 0 when SmallDataLimit module
16 ; flag is set to zero, and that the global-merge-min-data-size option overrides
17 ; the small data limit.
19 define void @f1(i32 %a) nounwind {
20 ; SMALL-DATA-LABEL: f1:
21 ; SMALL-DATA: # %bb.0:
22 ; SMALL-DATA-NEXT: lui a1, %hi(.L_MergedGlobals)
23 ; SMALL-DATA-NEXT: sw a0, %lo(.L_MergedGlobals)(a1)
24 ; SMALL-DATA-NEXT: addi a1, a1, %lo(.L_MergedGlobals)
25 ; SMALL-DATA-NEXT: sw a0, 4(a1)
26 ; SMALL-DATA-NEXT: sw a0, 8(a1)
27 ; SMALL-DATA-NEXT: sw a0, 12(a1)
28 ; SMALL-DATA-NEXT: ret
32 ; MINSIZE-NEXT: lui a1, %hi(ig1)
33 ; MINSIZE-NEXT: sw a0, %lo(ig1)(a1)
34 ; MINSIZE-NEXT: lui a1, %hi(ig2)
35 ; MINSIZE-NEXT: sw a0, %lo(ig2)(a1)
36 ; MINSIZE-NEXT: lui a1, %hi(eg1)
37 ; MINSIZE-NEXT: sw a0, %lo(eg1)(a1)
38 ; MINSIZE-NEXT: lui a1, %hi(eg2)
39 ; MINSIZE-NEXT: sw a0, %lo(eg2)(a1)
41 store i32 %a, ptr @ig1, align 4
42 store i32 %a, ptr @ig2, align 4
43 store i32 %a, ptr @eg1, align 4
44 store i32 %a, ptr @eg2, align 4
49 !llvm.module.flags = !{!0}
50 !0 = !{i32 8, !"SmallDataLimit", i32 0}