1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS32 3define i32 @Unconditional_branch(i32 %a, i32 %b) { 4; MIPS32-LABEL: Unconditional_branch: 5; MIPS32: # %bb.0: # %entry 6; MIPS32-NEXT: addiu $sp, $sp, -8 7; MIPS32-NEXT: .cfi_def_cfa_offset 8 8; MIPS32-NEXT: sw $4, 4($sp) # 4-byte Folded Spill 9; MIPS32-NEXT: j $BB0_2 10; MIPS32-NEXT: nop 11; MIPS32-NEXT: $BB0_1: # %end 12; MIPS32-NEXT: lw $2, 4($sp) # 4-byte Folded Reload 13; MIPS32-NEXT: addiu $sp, $sp, 8 14; MIPS32-NEXT: jr $ra 15; MIPS32-NEXT: nop 16; MIPS32-NEXT: $BB0_2: # %block 17; MIPS32-NEXT: j $BB0_1 18; MIPS32-NEXT: nop 19entry: 20 br label %block 21 ret i32 %b 22end: 23 ret i32 %a 24block: 25 br label %end 26} 27 28define i32 @Conditional_branch(i1 %cond, i32 %a, i32 %b) { 29; MIPS32-LABEL: Conditional_branch: 30; MIPS32: # %bb.0: 31; MIPS32-NEXT: addiu $sp, $sp, -8 32; MIPS32-NEXT: .cfi_def_cfa_offset 8 33; MIPS32-NEXT: sw $5, 0($sp) # 4-byte Folded Spill 34; MIPS32-NEXT: sw $6, 4($sp) # 4-byte Folded Spill 35; MIPS32-NEXT: andi $1, $4, 1 36; MIPS32-NEXT: bnez $1, $BB1_2 37; MIPS32-NEXT: nop 38; MIPS32-NEXT: # %bb.1: 39; MIPS32-NEXT: j $BB1_3 40; MIPS32-NEXT: nop 41; MIPS32-NEXT: $BB1_2: # %if.then 42; MIPS32-NEXT: lw $2, 0($sp) # 4-byte Folded Reload 43; MIPS32-NEXT: addiu $sp, $sp, 8 44; MIPS32-NEXT: jr $ra 45; MIPS32-NEXT: nop 46; MIPS32-NEXT: $BB1_3: # %if.else 47; MIPS32-NEXT: lw $2, 4($sp) # 4-byte Folded Reload 48; MIPS32-NEXT: addiu $sp, $sp, 8 49; MIPS32-NEXT: jr $ra 50; MIPS32-NEXT: nop 51 br i1 %cond, label %if.then, label %if.else 52if.then: 53 ret i32 %a 54if.else: 55 ret i32 %b 56} 57