10f669154SMichael Maitland; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2*3787fbf0SAlex Bradbury; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \ 3*3787fbf0SAlex Bradbury; RUN: | FileCheck %s -check-prefix=SMALL-DATA 4*3787fbf0SAlex Bradbury; RUN: llc -mtriple=riscv64 -global-merge-min-data-size=0 -verify-machineinstrs < %s \ 5ae4fc805SAlex Bradbury; RUN: | FileCheck %s -check-prefix=MINSIZE 60f669154SMichael Maitland 70f669154SMichael Maitland@ig1 = internal global i32 0, align 4 80f669154SMichael Maitland@ig2 = internal global i32 0, align 4 90f669154SMichael Maitland 100f669154SMichael Maitland@eg1 = dso_local global i32 0, align 4 110f669154SMichael Maitland@eg2 = dso_local global i32 0, align 4 120f669154SMichael Maitland 130f669154SMichael Maitland; This test shows that GlobalDataMinSize is set to SmallDataLimit + 1 when 140f669154SMichael Maitland; SmallDataLimit module flag is set as non-zero, and that global-merge-min-data-size 150f669154SMichael Maitland; overrides the small data limit. 160f669154SMichael Maitland 170f669154SMichael Maitlanddefine void @f1(i32 %a) nounwind { 180f669154SMichael Maitland; SMALL-DATA-LABEL: f1: 190f669154SMichael Maitland; SMALL-DATA: # %bb.0: 200f669154SMichael Maitland; SMALL-DATA-NEXT: lui a1, %hi(ig1) 210f669154SMichael Maitland; SMALL-DATA-NEXT: sw a0, %lo(ig1)(a1) 220f669154SMichael Maitland; SMALL-DATA-NEXT: lui a1, %hi(ig2) 230f669154SMichael Maitland; SMALL-DATA-NEXT: sw a0, %lo(ig2)(a1) 240f669154SMichael Maitland; SMALL-DATA-NEXT: lui a1, %hi(eg1) 250f669154SMichael Maitland; SMALL-DATA-NEXT: sw a0, %lo(eg1)(a1) 260f669154SMichael Maitland; SMALL-DATA-NEXT: lui a1, %hi(eg2) 270f669154SMichael Maitland; SMALL-DATA-NEXT: sw a0, %lo(eg2)(a1) 280f669154SMichael Maitland; SMALL-DATA-NEXT: ret 290f669154SMichael Maitland; 300f669154SMichael Maitland; MINSIZE-LABEL: f1: 310f669154SMichael Maitland; MINSIZE: # %bb.0: 320f669154SMichael Maitland; MINSIZE-NEXT: lui a1, %hi(.L_MergedGlobals) 330f669154SMichael Maitland; MINSIZE-NEXT: sw a0, %lo(.L_MergedGlobals)(a1) 340f669154SMichael Maitland; MINSIZE-NEXT: addi a1, a1, %lo(.L_MergedGlobals) 350f669154SMichael Maitland; MINSIZE-NEXT: sw a0, 4(a1) 360f669154SMichael Maitland; MINSIZE-NEXT: sw a0, 8(a1) 370f669154SMichael Maitland; MINSIZE-NEXT: sw a0, 12(a1) 380f669154SMichael Maitland; MINSIZE-NEXT: ret 390f669154SMichael Maitland store i32 %a, ptr @ig1, align 4 400f669154SMichael Maitland store i32 %a, ptr @ig2, align 4 410f669154SMichael Maitland store i32 %a, ptr @eg1, align 4 420f669154SMichael Maitland store i32 %a, ptr @eg2, align 4 430f669154SMichael Maitland ret void 440f669154SMichael Maitland} 450f669154SMichael Maitland 460f669154SMichael Maitland 470f669154SMichael Maitland!llvm.module.flags = !{!0} 480f669154SMichael Maitland!0 = !{i32 8, !"SmallDataLimit", i32 8} 49