111 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS323--- |4 5 define i32 @Unconditional_branch(i32 %a, i32 %b) {6 entry:7 br label %block8 9 end: ; preds = %block10 ret i32 %a11 12 block: ; preds = %entry13 br label %end14 }15 16 define i32 @Conditional_branch(i1 %cond, i32 %a, i32 %b) {17 br i1 %cond, label %if.then, label %if.else18 19 if.then: ; preds = %020 ret i32 %a21 22 if.else: ; preds = %023 ret i32 %b24 }25 26...27---28name: Unconditional_branch29alignment: 430legalized: true31regBankSelected: true32tracksRegLiveness: true33body: |34 ; MIPS32-LABEL: name: Unconditional_branch35 ; MIPS32: bb.0.entry:36 ; MIPS32-NEXT: successors: %bb.2(0x80000000)37 ; MIPS32-NEXT: liveins: $a0, $a138 ; MIPS32-NEXT: {{ $}}39 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $a040 ; MIPS32-NEXT: J %bb.2, implicit-def dead $at41 ; MIPS32-NEXT: {{ $}}42 ; MIPS32-NEXT: bb.1.end:43 ; MIPS32-NEXT: $v0 = COPY [[COPY]]44 ; MIPS32-NEXT: RetRA implicit $v045 ; 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 $at50 bb.1.entry:51 liveins: $a0, $a152 53 %0:gprb(s32) = COPY $a054 G_BR %bb.355 56 bb.2.end:57 $v0 = COPY %0(s32)58 RetRA implicit $v059 60 bb.3.block:61 G_BR %bb.262 63...64---65name: Conditional_branch66alignment: 467legalized: true68regBankSelected: true69tracksRegLiveness: true70body: |71 ; MIPS32-LABEL: name: Conditional_branch72 ; MIPS32: bb.0 (%ir-block.0):73 ; MIPS32-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)74 ; MIPS32-NEXT: liveins: $a0, $a1, $a275 ; MIPS32-NEXT: {{ $}}76 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $a077 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $a178 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:gpr32 = COPY $a279 ; MIPS32-NEXT: [[ANDi:%[0-9]+]]:gpr32 = ANDi [[COPY]], 180 ; MIPS32-NEXT: BNE [[ANDi]], $zero, %bb.1, implicit-def dead $at81 ; MIPS32-NEXT: J %bb.2, implicit-def dead $at82 ; MIPS32-NEXT: {{ $}}83 ; MIPS32-NEXT: bb.1.if.then:84 ; MIPS32-NEXT: $v0 = COPY [[COPY1]]85 ; MIPS32-NEXT: RetRA implicit $v086 ; MIPS32-NEXT: {{ $}}87 ; MIPS32-NEXT: bb.2.if.else:88 ; MIPS32-NEXT: $v0 = COPY [[COPY2]]89 ; MIPS32-NEXT: RetRA implicit $v090 bb.1 (%ir-block.0):91 liveins: $a0, $a1, $a292 93 %3:gprb(s32) = COPY $a094 %1:gprb(s32) = COPY $a195 %2:gprb(s32) = COPY $a296 %5:gprb(s32) = G_CONSTANT i32 197 %6:gprb(s32) = COPY %3(s32)98 %4:gprb(s32) = G_AND %6, %599 G_BRCOND %4(s32), %bb.2100 G_BR %bb.3101 102 bb.2.if.then:103 $v0 = COPY %1(s32)104 RetRA implicit $v0105 106 bb.3.if.else:107 $v0 = COPY %2(s32)108 RetRA implicit $v0109 110...111