1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
5 define i32 @Unconditional_branch(i32 %a, i32 %b) {
12 block: ; preds = %entry
16 define i32 @Conditional_branch(i1 %cond, i32 %a, i32 %b) {
17 br i1 %cond, label %if.then, label %if.else
28 name: Unconditional_branch
32 tracksRegLiveness: true
34 ; MIPS32-LABEL: name: Unconditional_branch
36 ; MIPS32-NEXT: successors: %bb.2(0x80000000)
37 ; MIPS32-NEXT: liveins: $a0, $a1
39 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
40 ; MIPS32-NEXT: J %bb.2, implicit-def dead $at
42 ; MIPS32-NEXT: bb.1.end:
43 ; MIPS32-NEXT: $v0 = COPY [[COPY]]
44 ; MIPS32-NEXT: RetRA implicit $v0
46 ; MIPS32-NEXT: bb.2.block:
47 ; MIPS32-NEXT: successors: %bb.1(0x80000000)
49 ; MIPS32-NEXT: J %bb.1, implicit-def dead $at
53 %0:gprb(s32) = COPY $a0
65 name: Conditional_branch
69 tracksRegLiveness: true
71 ; MIPS32-LABEL: name: Conditional_branch
72 ; MIPS32: bb.0 (%ir-block.0):
73 ; MIPS32-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
74 ; MIPS32-NEXT: liveins: $a0, $a1, $a2
76 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
77 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
78 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:gpr32 = COPY $a2
79 ; MIPS32-NEXT: [[ANDi:%[0-9]+]]:gpr32 = ANDi [[COPY]], 1
80 ; MIPS32-NEXT: BNE [[ANDi]], $zero, %bb.1, implicit-def $at
81 ; MIPS32-NEXT: J %bb.2, implicit-def dead $at
83 ; MIPS32-NEXT: bb.1.if.then:
84 ; MIPS32-NEXT: $v0 = COPY [[COPY1]]
85 ; MIPS32-NEXT: RetRA implicit $v0
87 ; MIPS32-NEXT: bb.2.if.else:
88 ; MIPS32-NEXT: $v0 = COPY [[COPY2]]
89 ; MIPS32-NEXT: RetRA implicit $v0
91 liveins: $a0, $a1, $a2
93 %3:gprb(s32) = COPY $a0
94 %1:gprb(s32) = COPY $a1
95 %2:gprb(s32) = COPY $a2
96 %5:gprb(s32) = G_CONSTANT i32 1
97 %6:gprb(s32) = COPY %3(s32)
98 %4:gprb(s32) = G_AND %6, %5
99 G_BRCOND %4(s32), %bb.2