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: successors: %bb.2(0x80000000)
37 ; MIPS32: liveins: $a0, $a1
38 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
39 ; MIPS32: J %bb.2, implicit-def $at
41 ; MIPS32: $v0 = COPY [[COPY]]
42 ; MIPS32: RetRA implicit $v0
44 ; MIPS32: successors: %bb.1(0x80000000)
45 ; MIPS32: J %bb.1, implicit-def $at
49 %0:gprb(s32) = COPY $a0
61 name: Conditional_branch
65 tracksRegLiveness: true
67 ; MIPS32-LABEL: name: Conditional_branch
68 ; MIPS32: bb.0 (%ir-block.0):
69 ; MIPS32: successors: %bb.1(0x40000000), %bb.2(0x40000000)
70 ; MIPS32: liveins: $a0, $a1, $a2
71 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
72 ; MIPS32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
73 ; MIPS32: [[COPY2:%[0-9]+]]:gpr32 = COPY $a2
74 ; MIPS32: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 1
75 ; MIPS32: [[AND:%[0-9]+]]:gpr32 = AND [[COPY]], [[ORi]]
76 ; MIPS32: BNE [[AND]], $zero, %bb.1, implicit-def $at
77 ; MIPS32: J %bb.2, implicit-def $at
78 ; MIPS32: bb.1.if.then:
79 ; MIPS32: $v0 = COPY [[COPY1]]
80 ; MIPS32: RetRA implicit $v0
81 ; MIPS32: bb.2.if.else:
82 ; MIPS32: $v0 = COPY [[COPY2]]
83 ; MIPS32: RetRA implicit $v0
85 liveins: $a0, $a1, $a2
87 %3:gprb(s32) = COPY $a0
88 %1:gprb(s32) = COPY $a1
89 %2:gprb(s32) = COPY $a2
90 %5:gprb(s32) = G_CONSTANT i32 1
91 %6:gprb(s32) = COPY %3(s32)
92 %4:gprb(s32) = G_AND %6, %5
93 G_BRCOND %4(s32), %bb.2