| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 |
| ; RUN: llc --mtriple=loongarch64 -mattr=+d,+lsx --verify-machineinstrs < %s | FileCheck %s |
| define void @eliminate_frame_index(<16 x i8> %a) nounwind { |
| ; CHECK-LABEL: eliminate_frame_index: |
| ; CHECK: # %bb.0: |
| ; CHECK-NEXT: addi.d $sp, $sp, -240 |
| ; CHECK-NEXT: st.d $ra, $sp, 232 # 8-byte Folded Spill |
| ; CHECK-NEXT: st.d $fp, $sp, 224 # 8-byte Folded Spill |
| ; CHECK-NEXT: st.d $s0, $sp, 216 # 8-byte Folded Spill |
| ; CHECK-NEXT: st.d $s1, $sp, 208 # 8-byte Folded Spill |
| ; CHECK-NEXT: st.d $s2, $sp, 200 # 8-byte Folded Spill |
| ; CHECK-NEXT: st.d $s3, $sp, 192 # 8-byte Folded Spill |
| ; CHECK-NEXT: st.d $s4, $sp, 184 # 8-byte Folded Spill |
| ; CHECK-NEXT: st.d $s5, $sp, 176 # 8-byte Folded Spill |
| ; CHECK-NEXT: st.d $s6, $sp, 168 # 8-byte Folded Spill |
| ; CHECK-NEXT: st.d $s7, $sp, 160 # 8-byte Folded Spill |
| ; CHECK-NEXT: st.d $s8, $sp, 152 # 8-byte Folded Spill |
| ; 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: st.d $a0, $sp, 0 # 8-byte Folded Spill |
| ; CHECK-NEXT: addi.d $a0, $sp, 136 |
| ; CHECK-NEXT: vstelm.b $vr0, $a0, 0, 0 |
| ; CHECK-NEXT: ld.d $a0, $sp, 0 # 8-byte Folded Reload |
| ; 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: ld.d $s8, $sp, 152 # 8-byte Folded Reload |
| ; CHECK-NEXT: ld.d $s7, $sp, 160 # 8-byte Folded Reload |
| ; CHECK-NEXT: ld.d $s6, $sp, 168 # 8-byte Folded Reload |
| ; CHECK-NEXT: ld.d $s5, $sp, 176 # 8-byte Folded Reload |
| ; CHECK-NEXT: ld.d $s4, $sp, 184 # 8-byte Folded Reload |
| ; CHECK-NEXT: ld.d $s3, $sp, 192 # 8-byte Folded Reload |
| ; CHECK-NEXT: ld.d $s2, $sp, 200 # 8-byte Folded Reload |
| ; CHECK-NEXT: ld.d $s1, $sp, 208 # 8-byte Folded Reload |
| ; CHECK-NEXT: ld.d $s0, $sp, 216 # 8-byte Folded Reload |
| ; CHECK-NEXT: ld.d $fp, $sp, 224 # 8-byte Folded Reload |
| ; CHECK-NEXT: ld.d $ra, $sp, 232 # 8-byte Folded Reload |
| ; CHECK-NEXT: addi.d $sp, $sp, 240 |
| ; CHECK-NEXT: ret |
| %s = alloca [16 x i8] |
| %ss = alloca [128 x i8] |
| |
| %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}"() |
| |
| %e = extractelement <16 x i8> %a, i64 0 |
| |
| store volatile i8 %e, ptr %s |
| |
| 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 |
| } |