1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \ 3; RUN: | FileCheck %s -check-prefix=SMALL-DATA 4; RUN: llc -mtriple=riscv64 -global-merge-min-data-size=5 -verify-machineinstrs < %s \ 5; RUN: | FileCheck %s -check-prefix=MINSIZE 6 7@ig1 = internal global i32 0, align 4 8@ig2 = internal global i32 0, align 4 9 10@eg1 = dso_local global i32 0, align 4 11@eg2 = dso_local global i32 0, align 4 12 13 14; This test shows that GlobalDataMinSize is set to 0 when SmallDataLimit module 15; flag is set to zero, and that the global-merge-min-data-size option overrides 16; the small data limit. 17 18define void @f1(i32 %a) nounwind { 19; SMALL-DATA-LABEL: f1: 20; SMALL-DATA: # %bb.0: 21; SMALL-DATA-NEXT: lui a1, %hi(.L_MergedGlobals) 22; SMALL-DATA-NEXT: sw a0, %lo(.L_MergedGlobals)(a1) 23; SMALL-DATA-NEXT: addi a1, a1, %lo(.L_MergedGlobals) 24; SMALL-DATA-NEXT: sw a0, 4(a1) 25; SMALL-DATA-NEXT: sw a0, 8(a1) 26; SMALL-DATA-NEXT: sw a0, 12(a1) 27; SMALL-DATA-NEXT: ret 28; 29; MINSIZE-LABEL: f1: 30; MINSIZE: # %bb.0: 31; MINSIZE-NEXT: lui a1, %hi(ig1) 32; MINSIZE-NEXT: sw a0, %lo(ig1)(a1) 33; MINSIZE-NEXT: lui a1, %hi(ig2) 34; MINSIZE-NEXT: sw a0, %lo(ig2)(a1) 35; MINSIZE-NEXT: lui a1, %hi(eg1) 36; MINSIZE-NEXT: sw a0, %lo(eg1)(a1) 37; MINSIZE-NEXT: lui a1, %hi(eg2) 38; MINSIZE-NEXT: sw a0, %lo(eg2)(a1) 39; MINSIZE-NEXT: ret 40 store i32 %a, ptr @ig1, align 4 41 store i32 %a, ptr @ig2, align 4 42 store i32 %a, ptr @eg1, align 4 43 store i32 %a, ptr @eg2, align 4 44 ret void 45} 46 47 48!llvm.module.flags = !{!0} 49!0 = !{i32 8, !"SmallDataLimit", i32 0} 50