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 3--- | 4 5 define i32 @Unconditional_branch(i32 %a, i32 %b) { 6 entry: 7 br label %block 8 9 end: ; preds = %block 10 ret i32 %a 11 12 block: ; preds = %entry 13 br label %end 14 } 15 16 define i32 @Conditional_branch(i1 %cond, i32 %a, i32 %b) { 17 br i1 %cond, label %if.then, label %if.else 18 19 if.then: ; preds = %0 20 ret i32 %a 21 22 if.else: ; preds = %0 23 ret i32 %b 24 } 25 26... 27--- 28name: Unconditional_branch 29alignment: 4 30legalized: true 31regBankSelected: true 32tracksRegLiveness: true 33body: | 34 ; MIPS32-LABEL: name: Unconditional_branch 35 ; MIPS32: bb.0.entry: 36 ; MIPS32-NEXT: successors: %bb.2(0x80000000) 37 ; MIPS32-NEXT: liveins: $a0, $a1 38 ; MIPS32-NEXT: {{ $}} 39 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $a0 40 ; MIPS32-NEXT: J %bb.2, implicit-def dead $at 41 ; MIPS32-NEXT: {{ $}} 42 ; MIPS32-NEXT: bb.1.end: 43 ; MIPS32-NEXT: $v0 = COPY [[COPY]] 44 ; MIPS32-NEXT: RetRA implicit $v0 45 ; MIPS32-NEXT: {{ $}} 46 ; MIPS32-NEXT: bb.2.block: 47 ; MIPS32-NEXT: successors: %bb.1(0x80000000) 48 ; MIPS32-NEXT: {{ $}} 49 ; MIPS32-NEXT: J %bb.1, implicit-def dead $at 50 bb.1.entry: 51 liveins: $a0, $a1 52 53 %0:gprb(s32) = COPY $a0 54 G_BR %bb.3 55 56 bb.2.end: 57 $v0 = COPY %0(s32) 58 RetRA implicit $v0 59 60 bb.3.block: 61 G_BR %bb.2 62 63... 64--- 65name: Conditional_branch 66alignment: 4 67legalized: true 68regBankSelected: true 69tracksRegLiveness: true 70body: | 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 75 ; MIPS32-NEXT: {{ $}} 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 dead $at 81 ; MIPS32-NEXT: J %bb.2, implicit-def dead $at 82 ; MIPS32-NEXT: {{ $}} 83 ; MIPS32-NEXT: bb.1.if.then: 84 ; MIPS32-NEXT: $v0 = COPY [[COPY1]] 85 ; MIPS32-NEXT: RetRA implicit $v0 86 ; MIPS32-NEXT: {{ $}} 87 ; MIPS32-NEXT: bb.2.if.else: 88 ; MIPS32-NEXT: $v0 = COPY [[COPY2]] 89 ; MIPS32-NEXT: RetRA implicit $v0 90 bb.1 (%ir-block.0): 91 liveins: $a0, $a1, $a2 92 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 100 G_BR %bb.3 101 102 bb.2.if.then: 103 $v0 = COPY %1(s32) 104 RetRA implicit $v0 105 106 bb.3.if.else: 107 $v0 = COPY %2(s32) 108 RetRA implicit $v0 109 110... 111