1 # RUN: llc -march=mips64 -target-abi n64 -start-before=finalize-isel \
2 # RUN: -stop-after=finalize-isel -relocation-model=pic \
5 # A simple test to show that we can parse the target specific flags: gpoff-hi,
6 # gpoff-lo, got-call, got-disp.
9 @v = global i32 0, align 4
10 @j = external global i32, align 4
12 define i32 @_Z2k1i(i32 signext %asd) {
14 %call = tail call i32 @_Z1gi(i32 signext %asd)
15 %add = add nsw i32 %call, %asd
16 %0 = load i32, i32* @v, align 4
17 %add1 = add nsw i32 %add, %0
18 %1 = load i32, i32* @j, align 4
19 %add2 = add nsw i32 %add1, %1
23 declare i32 @_Z1gi(i32 signext)
28 exposesReturnsTwice: false
30 regBankSelected: false
32 tracksRegLiveness: true
34 - { id: 0, class: gpr64, preferred-register: '' }
35 - { id: 1, class: gpr64, preferred-register: '' }
36 - { id: 2, class: gpr64, preferred-register: '' }
37 - { id: 3, class: gpr32, preferred-register: '' }
38 - { id: 4, class: gpr32, preferred-register: '' }
39 - { id: 5, class: gpr32, preferred-register: '' }
40 - { id: 6, class: gpr64, preferred-register: '' }
41 - { id: 7, class: gpr32, preferred-register: '' }
42 - { id: 8, class: gpr32, preferred-register: '' }
43 - { id: 9, class: gpr64, preferred-register: '' }
44 - { id: 10, class: gpr32, preferred-register: '' }
45 - { id: 11, class: gpr32, preferred-register: '' }
46 - { id: 12, class: gpr64, preferred-register: '' }
47 - { id: 13, class: gpr64, preferred-register: '' }
49 - { reg: '$a0_64', virtual-reg: '%0' }
50 - { reg: '$t9_64', virtual-reg: '' }
52 isFrameAddressTaken: false
53 isReturnAddressTaken: false
62 maxCallFrameSize: 4294967295
63 hasOpaqueSPAdjustment: false
65 hasMustTailInVarArgFunc: false
73 liveins: $a0_64, $t9_64
75 %12 = LUi64 target-flags(mips-gpoff-hi) @_Z2k1i
76 %13 = DADDu %12, $t9_64
77 %1 = DADDiu %13, target-flags(mips-gpoff-lo) @_Z2k1i
79 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
80 %2 = LD %1, target-flags(mips-got-call) @_Z1gi :: (load 8 from call-entry @_Z1gi)
83 JALR64Pseudo killed %2, csr_n64, implicit-def dead $ra, implicit $a0_64, implicit $gp_64, implicit-def $sp, implicit-def $v0
84 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
87 %5 = ADDu %3, killed %4
88 %6 = LD %1, target-flags(mips-got-disp) @v :: (load 8 from got)
89 %7 = LW killed %6, 0 :: (dereferenceable load 4 from @v)
90 %8 = ADDu killed %5, killed %7
91 %9 = LD %1, target-flags(mips-got-disp) @j :: (load 8 from got)
92 %10 = LW killed %9, 0 :: (dereferenceable load 4 from @j)
93 %11 = ADDu killed %8, killed %10