1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch32 -mattr=+d --filetype=obj --verify-machineinstrs < %s \
3 ; RUN: -o /dev/null 2>&1
4 ; RUN: llc --mtriple=loongarch64 -mattr=+d --filetype=obj --verify-machineinstrs < %s \
5 ; RUN: -o /dev/null 2>&1
6 ; RUN: llc --mtriple=loongarch32 -mattr=+d --verify-machineinstrs < %s | FileCheck %s --check-prefix=LA32
7 ; RUN: llc --mtriple=loongarch64 -mattr=+d --verify-machineinstrs < %s | FileCheck %s --check-prefix=LA64
9 define i32 @relax_b18(i32 signext %a, i32 signext %b) {
10 ; LA32-LABEL: relax_b18:
12 ; LA32-NEXT: beq $a0, $a1, .LBB0_1
13 ; LA32-NEXT: b .LBB0_2
14 ; LA32-NEXT: .LBB0_1: # %iftrue
15 ; LA32-NEXT: ori $a0, $zero, 1
17 ; LA32-NEXT: .space 1048576
20 ; LA32-NEXT: .LBB0_2: # %iffalse
21 ; LA32-NEXT: move $a0, $zero
24 ; LA64-LABEL: relax_b18:
26 ; LA64-NEXT: beq $a0, $a1, .LBB0_1
27 ; LA64-NEXT: b .LBB0_2
28 ; LA64-NEXT: .LBB0_1: # %iftrue
29 ; LA64-NEXT: ori $a0, $zero, 1
31 ; LA64-NEXT: .space 1048576
34 ; LA64-NEXT: .LBB0_2: # %iffalse
35 ; LA64-NEXT: move $a0, $zero
37 %cond = icmp eq i32 %a, %b
38 br i1 %cond, label %iftrue, label %iffalse
41 call void asm sideeffect ".space 1048576", ""()
48 define i32 @relax_b23(i1 %a) {
49 ; LA32-LABEL: relax_b23:
51 ; LA32-NEXT: andi $a0, $a0, 1
52 ; LA32-NEXT: bnez $a0, .LBB1_1
53 ; LA32-NEXT: b .LBB1_2
54 ; LA32-NEXT: .LBB1_1: # %iftrue
55 ; LA32-NEXT: ori $a0, $zero, 1
57 ; LA32-NEXT: .space 16777216
60 ; LA32-NEXT: .LBB1_2: # %iffalse
61 ; LA32-NEXT: move $a0, $zero
64 ; LA64-LABEL: relax_b23:
66 ; LA64-NEXT: andi $a0, $a0, 1
67 ; LA64-NEXT: bnez $a0, .LBB1_1
68 ; LA64-NEXT: b .LBB1_2
69 ; LA64-NEXT: .LBB1_1: # %iftrue
70 ; LA64-NEXT: ori $a0, $zero, 1
72 ; LA64-NEXT: .space 16777216
75 ; LA64-NEXT: .LBB1_2: # %iffalse
76 ; LA64-NEXT: move $a0, $zero
78 br i1 %a, label %iftrue, label %iffalse
81 call void asm sideeffect ".space 16777216", ""()
88 define i32 @relax_b28(i1 %a) {
89 ; LA32-LABEL: relax_b28:
91 ; LA32-NEXT: addi.w $sp, $sp, -16
92 ; LA32-NEXT: .cfi_def_cfa_offset 16
93 ; LA32-NEXT: andi $a0, $a0, 1
94 ; LA32-NEXT: bnez $a0, .LBB2_1
96 ; LA32-NEXT: pcalau12i $a0, %pc_hi20(.LBB2_2)
97 ; LA32-NEXT: addi.w $a0, $a0, %pc_lo12(.LBB2_2)
99 ; LA32-NEXT: .LBB2_1: # %iftrue
100 ; LA32-NEXT: ori $a0, $zero, 1
102 ; LA32-NEXT: .space 536870912
104 ; LA32-NEXT: addi.w $sp, $sp, 16
106 ; LA32-NEXT: .LBB2_2: # %iffalse
107 ; LA32-NEXT: move $a0, $zero
108 ; LA32-NEXT: addi.w $sp, $sp, 16
111 ; LA64-LABEL: relax_b28:
113 ; LA64-NEXT: addi.d $sp, $sp, -16
114 ; LA64-NEXT: .cfi_def_cfa_offset 16
115 ; LA64-NEXT: andi $a0, $a0, 1
116 ; LA64-NEXT: bnez $a0, .LBB2_1
117 ; LA64-NEXT: # %bb.3:
118 ; LA64-NEXT: pcalau12i $a0, %pc_hi20(.LBB2_2)
119 ; LA64-NEXT: addi.d $a0, $a0, %pc_lo12(.LBB2_2)
121 ; LA64-NEXT: .LBB2_1: # %iftrue
122 ; LA64-NEXT: ori $a0, $zero, 1
124 ; LA64-NEXT: .space 536870912
126 ; LA64-NEXT: addi.d $sp, $sp, 16
128 ; LA64-NEXT: .LBB2_2: # %iffalse
129 ; LA64-NEXT: move $a0, $zero
130 ; LA64-NEXT: addi.d $sp, $sp, 16
132 br i1 %a, label %iftrue, label %iffalse
135 call void asm sideeffect ".space 536870912", ""()