1# RUN: llc -march=mips64 -target-abi n64 -start-before=finalize-isel \ 2# RUN: -stop-after=finalize-isel -relocation-model=pic \ 3# RUN: -o /dev/null %s 4 5# A simple test to show that we can parse the target specific flags: gpoff-hi, 6# gpoff-lo, got-call, got-disp. 7 8--- | 9 @v = global i32 0, align 4 10 @j = external global i32, align 4 11 12 define i32 @_Z2k1i(i32 signext %asd) { 13 entry: 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 20 ret i32 %add2 21 } 22 23 declare i32 @_Z1gi(i32 signext) 24... 25--- 26name: _Z2k1i 27alignment: 8 28exposesReturnsTwice: false 29legalized: false 30regBankSelected: false 31selected: false 32tracksRegLiveness: true 33registers: 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: '' } 48liveins: 49 - { reg: '$a0_64', virtual-reg: '%0' } 50 - { reg: '$t9_64', virtual-reg: '' } 51frameInfo: 52 isFrameAddressTaken: false 53 isReturnAddressTaken: false 54 hasStackMap: false 55 hasPatchPoint: false 56 stackSize: 0 57 offsetAdjustment: 0 58 maxAlignment: 1 59 adjustsStack: false 60 hasCalls: true 61 stackProtector: '' 62 maxCallFrameSize: 4294967295 63 hasOpaqueSPAdjustment: false 64 hasVAStart: false 65 hasMustTailInVarArgFunc: false 66 savePoint: '' 67 restorePoint: '' 68fixedStack: 69stack: 70constants: 71body: | 72 bb.0.entry: 73 liveins: $a0_64, $t9_64 74 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 78 %0 = COPY $a0_64 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) 81 $a0_64 = COPY %0 82 $gp_64 = COPY %1 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 85 %3 = COPY $v0 86 %4 = COPY %0.sub_32 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 94 $v0 = COPY %11 95 RetRA implicit $v0 96 97... 98 99