blob: 1c4ef48a976181620f7246bdede559b96c960eca [file] [log] [blame]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc --mtriple=loongarch64 --filetype=obj --verify-machineinstrs < %s \
; RUN: -o /dev/null 2>&1
; RUN: llc --mtriple=loongarch64 --verify-machineinstrs < %s | FileCheck %s
define void @relax_b28_spill() {
; CHECK-LABEL: relax_b28_spill:
; CHECK: # %bb.0:
; CHECK-NEXT: addi.d $sp, $sp, -96
; CHECK-NEXT: .cfi_def_cfa_offset 96
; CHECK-NEXT: st.d $ra, $sp, 88 # 8-byte Folded Spill
; CHECK-NEXT: st.d $fp, $sp, 80 # 8-byte Folded Spill
; CHECK-NEXT: st.d $s0, $sp, 72 # 8-byte Folded Spill
; CHECK-NEXT: st.d $s1, $sp, 64 # 8-byte Folded Spill
; CHECK-NEXT: st.d $s2, $sp, 56 # 8-byte Folded Spill
; CHECK-NEXT: st.d $s3, $sp, 48 # 8-byte Folded Spill
; CHECK-NEXT: st.d $s4, $sp, 40 # 8-byte Folded Spill
; CHECK-NEXT: st.d $s5, $sp, 32 # 8-byte Folded Spill
; CHECK-NEXT: st.d $s6, $sp, 24 # 8-byte Folded Spill
; CHECK-NEXT: st.d $s7, $sp, 16 # 8-byte Folded Spill
; CHECK-NEXT: st.d $s8, $sp, 8 # 8-byte Folded Spill
; CHECK-NEXT: .cfi_offset 1, -8
; CHECK-NEXT: .cfi_offset 22, -16
; CHECK-NEXT: .cfi_offset 23, -24
; CHECK-NEXT: .cfi_offset 24, -32
; CHECK-NEXT: .cfi_offset 25, -40
; CHECK-NEXT: .cfi_offset 26, -48
; CHECK-NEXT: .cfi_offset 27, -56
; CHECK-NEXT: .cfi_offset 28, -64
; CHECK-NEXT: .cfi_offset 29, -72
; CHECK-NEXT: .cfi_offset 30, -80
; CHECK-NEXT: .cfi_offset 31, -88
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $zero, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $ra, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $tp, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $a0, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $a1, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $a2, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $a3, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $a4, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $a5, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $a6, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $a7, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $t0, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $t1, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $t2, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $t3, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $t4, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $t5, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $t6, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $t7, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $t8, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $fp, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $s0, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $s1, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $s2, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $s3, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $s4, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $s5, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $s6, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $s7, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: addi.d $s8, $zero, 1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: beq $s7, $s8, .LBB0_1
; CHECK-NEXT: # %bb.4:
; CHECK-NEXT: st.d $t8, $sp, 0
; CHECK-NEXT: pcalau12i $t8, %pc_hi20(.LBB0_5)
; CHECK-NEXT: addi.d $t8, $t8, %pc_lo12(.LBB0_5)
; CHECK-NEXT: jr $t8
; CHECK-NEXT: .LBB0_1: # %iftrue
; CHECK-NEXT: #APP
; CHECK-NEXT: .space 536870912
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: b .LBB0_3
; CHECK-NEXT: .LBB0_5: # %iffalse
; CHECK-NEXT: ld.d $t8, $sp, 0
; CHECK-NEXT: # %bb.2: # %iffalse
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $zero
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $ra
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $tp
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $a0
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $a1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $a2
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $a3
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $a4
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $a5
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $a6
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $a7
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $t0
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $t1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $t2
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $t3
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $t4
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $t5
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $t6
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $t7
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $t8
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $fp
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $s0
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $s1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $s2
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $s3
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $s4
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $s5
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $s6
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $s7
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: #APP
; CHECK-NEXT: # reg use $s8
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: .LBB0_3: # %iftrue
; CHECK-NEXT: ld.d $s8, $sp, 8 # 8-byte Folded Reload
; CHECK-NEXT: ld.d $s7, $sp, 16 # 8-byte Folded Reload
; CHECK-NEXT: ld.d $s6, $sp, 24 # 8-byte Folded Reload
; CHECK-NEXT: ld.d $s5, $sp, 32 # 8-byte Folded Reload
; CHECK-NEXT: ld.d $s4, $sp, 40 # 8-byte Folded Reload
; CHECK-NEXT: ld.d $s3, $sp, 48 # 8-byte Folded Reload
; CHECK-NEXT: ld.d $s2, $sp, 56 # 8-byte Folded Reload
; CHECK-NEXT: ld.d $s1, $sp, 64 # 8-byte Folded Reload
; CHECK-NEXT: ld.d $s0, $sp, 72 # 8-byte Folded Reload
; CHECK-NEXT: ld.d $fp, $sp, 80 # 8-byte Folded Reload
; CHECK-NEXT: ld.d $ra, $sp, 88 # 8-byte Folded Reload
; CHECK-NEXT: addi.d $sp, $sp, 96
; CHECK-NEXT: ret
%zero = call i64 asm sideeffect "addi.d $$zero, $$zero, 1", "={r0}"()
%ra = call i64 asm sideeffect "addi.d $$ra, $$zero, 1", "={r1}"()
%tp = call i64 asm sideeffect "addi.d $$tp, $$zero, 1", "={r2}"()
%a0 = call i64 asm sideeffect "addi.d $$a0, $$zero, 1", "={r4}"()
%a1 = call i64 asm sideeffect "addi.d $$a1, $$zero, 1", "={r5}"()
%a2 = call i64 asm sideeffect "addi.d $$a2, $$zero, 1", "={r6}"()
%a3 = call i64 asm sideeffect "addi.d $$a3, $$zero, 1", "={r7}"()
%a4 = call i64 asm sideeffect "addi.d $$a4, $$zero, 1", "={r8}"()
%a5 = call i64 asm sideeffect "addi.d $$a5, $$zero, 1", "={r9}"()
%a6 = call i64 asm sideeffect "addi.d $$a6, $$zero, 1", "={r10}"()
%a7 = call i64 asm sideeffect "addi.d $$a7, $$zero, 1", "={r11}"()
%t0 = call i64 asm sideeffect "addi.d $$t0, $$zero, 1", "={r12}"()
%t1 = call i64 asm sideeffect "addi.d $$t1, $$zero, 1", "={r13}"()
%t2 = call i64 asm sideeffect "addi.d $$t2, $$zero, 1", "={r14}"()
%t3 = call i64 asm sideeffect "addi.d $$t3, $$zero, 1", "={r15}"()
%t4 = call i64 asm sideeffect "addi.d $$t4, $$zero, 1", "={r16}"()
%t5 = call i64 asm sideeffect "addi.d $$t5, $$zero, 1", "={r17}"()
%t6 = call i64 asm sideeffect "addi.d $$t6, $$zero, 1", "={r18}"()
%t7 = call i64 asm sideeffect "addi.d $$t7, $$zero, 1", "={r19}"()
%t8 = call i64 asm sideeffect "addi.d $$t8, $$zero, 1", "={r20}"()
;; r21 Reserved (Non-allocatable)
%s9 = call i64 asm sideeffect "addi.d $$s9, $$zero, 1", "={r22}"()
%s0 = call i64 asm sideeffect "addi.d $$s0, $$zero, 1", "={r23}"()
%s1 = call i64 asm sideeffect "addi.d $$s1, $$zero, 1", "={r24}"()
%s2 = call i64 asm sideeffect "addi.d $$s2, $$zero, 1", "={r25}"()
%s3 = call i64 asm sideeffect "addi.d $$s3, $$zero, 1", "={r26}"()
%s4 = call i64 asm sideeffect "addi.d $$s4, $$zero, 1", "={r27}"()
%s5 = call i64 asm sideeffect "addi.d $$s5, $$zero, 1", "={r28}"()
%s6 = call i64 asm sideeffect "addi.d $$s6, $$zero, 1", "={r29}"()
%s7 = call i64 asm sideeffect "addi.d $$s7, $$zero, 1", "={r30}"()
%s8 = call i64 asm sideeffect "addi.d $$s8, $$zero, 1", "={r31}"()
%cmp = icmp eq i64 %s7, %s8
br i1 %cmp, label %iftrue, label %iffalse
iftrue:
call void asm sideeffect ".space 536870912", ""()
ret void
iffalse:
call void asm sideeffect "# reg use $0", "{r0}"(i64 %zero)
call void asm sideeffect "# reg use $0", "{r1}"(i64 %ra)
call void asm sideeffect "# reg use $0", "{r2}"(i64 %tp)
call void asm sideeffect "# reg use $0", "{r4}"(i64 %a0)
call void asm sideeffect "# reg use $0", "{r5}"(i64 %a1)
call void asm sideeffect "# reg use $0", "{r6}"(i64 %a2)
call void asm sideeffect "# reg use $0", "{r7}"(i64 %a3)
call void asm sideeffect "# reg use $0", "{r8}"(i64 %a4)
call void asm sideeffect "# reg use $0", "{r9}"(i64 %a5)
call void asm sideeffect "# reg use $0", "{r10}"(i64 %a6)
call void asm sideeffect "# reg use $0", "{r11}"(i64 %a7)
call void asm sideeffect "# reg use $0", "{r12}"(i64 %t0)
call void asm sideeffect "# reg use $0", "{r13}"(i64 %t1)
call void asm sideeffect "# reg use $0", "{r14}"(i64 %t2)
call void asm sideeffect "# reg use $0", "{r15}"(i64 %t3)
call void asm sideeffect "# reg use $0", "{r16}"(i64 %t4)
call void asm sideeffect "# reg use $0", "{r17}"(i64 %t5)
call void asm sideeffect "# reg use $0", "{r18}"(i64 %t6)
call void asm sideeffect "# reg use $0", "{r19}"(i64 %t7)
call void asm sideeffect "# reg use $0", "{r20}"(i64 %t8)
;; r21 Reserved (Non-allocatable)
call void asm sideeffect "# reg use $0", "{r22}"(i64 %s9)
call void asm sideeffect "# reg use $0", "{r23}"(i64 %s0)
call void asm sideeffect "# reg use $0", "{r24}"(i64 %s1)
call void asm sideeffect "# reg use $0", "{r25}"(i64 %s2)
call void asm sideeffect "# reg use $0", "{r26}"(i64 %s3)
call void asm sideeffect "# reg use $0", "{r27}"(i64 %s4)
call void asm sideeffect "# reg use $0", "{r28}"(i64 %s5)
call void asm sideeffect "# reg use $0", "{r29}"(i64 %s6)
call void asm sideeffect "# reg use $0", "{r30}"(i64 %s7)
call void asm sideeffect "# reg use $0", "{r31}"(i64 %s8)
ret void
}