| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| ; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS32 |
| |
| define i1 @test_i1(i1 %cnd, i1 %a, i1 %b) { |
| ; MIPS32-LABEL: test_i1: |
| ; MIPS32: # %bb.0: # %entry |
| ; MIPS32-NEXT: addiu $sp, $sp, -16 |
| ; MIPS32-NEXT: .cfi_def_cfa_offset 16 |
| ; MIPS32-NEXT: ori $1, $zero, 1 |
| ; MIPS32-NEXT: and $1, $4, $1 |
| ; MIPS32-NEXT: sw $5, 12($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: sw $6, 8($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: bnez $1, $BB0_2 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: # %bb.1: # %entry |
| ; MIPS32-NEXT: j $BB0_3 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: $BB0_2: # %cond.true |
| ; MIPS32-NEXT: lw $1, 12($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: j $BB0_4 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: $BB0_3: # %cond.false |
| ; MIPS32-NEXT: lw $1, 8($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: $BB0_4: # %cond.end |
| ; MIPS32-NEXT: lw $1, 4($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: move $2, $1 |
| ; MIPS32-NEXT: addiu $sp, $sp, 16 |
| ; MIPS32-NEXT: jr $ra |
| ; MIPS32-NEXT: nop |
| entry: |
| br i1 %cnd, label %cond.true, label %cond.false |
| |
| cond.true: |
| br label %cond.end |
| |
| cond.false: |
| br label %cond.end |
| |
| cond.end: |
| %cond = phi i1 [ %a, %cond.true ], [ %b, %cond.false ] |
| ret i1 %cond |
| } |
| |
| define i8 @test_i8(i1 %cnd, i8 %a, i8 %b) { |
| ; MIPS32-LABEL: test_i8: |
| ; MIPS32: # %bb.0: # %entry |
| ; MIPS32-NEXT: addiu $sp, $sp, -16 |
| ; MIPS32-NEXT: .cfi_def_cfa_offset 16 |
| ; MIPS32-NEXT: ori $1, $zero, 1 |
| ; MIPS32-NEXT: and $1, $4, $1 |
| ; MIPS32-NEXT: sw $5, 12($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: sw $6, 8($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: bnez $1, $BB1_2 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: # %bb.1: # %entry |
| ; MIPS32-NEXT: j $BB1_3 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: $BB1_2: # %cond.true |
| ; MIPS32-NEXT: lw $1, 12($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: j $BB1_4 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: $BB1_3: # %cond.false |
| ; MIPS32-NEXT: lw $1, 8($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: $BB1_4: # %cond.end |
| ; MIPS32-NEXT: lw $1, 4($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: move $2, $1 |
| ; MIPS32-NEXT: addiu $sp, $sp, 16 |
| ; MIPS32-NEXT: jr $ra |
| ; MIPS32-NEXT: nop |
| entry: |
| br i1 %cnd, label %cond.true, label %cond.false |
| |
| cond.true: |
| br label %cond.end |
| |
| cond.false: |
| br label %cond.end |
| |
| cond.end: |
| %cond = phi i8 [ %a, %cond.true ], [ %b, %cond.false ] |
| ret i8 %cond |
| } |
| |
| define i16 @test_i16(i1 %cnd, i16 %a, i16 %b) { |
| ; MIPS32-LABEL: test_i16: |
| ; MIPS32: # %bb.0: # %entry |
| ; MIPS32-NEXT: addiu $sp, $sp, -16 |
| ; MIPS32-NEXT: .cfi_def_cfa_offset 16 |
| ; MIPS32-NEXT: ori $1, $zero, 1 |
| ; MIPS32-NEXT: and $1, $4, $1 |
| ; MIPS32-NEXT: sw $5, 12($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: sw $6, 8($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: bnez $1, $BB2_2 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: # %bb.1: # %entry |
| ; MIPS32-NEXT: j $BB2_3 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: $BB2_2: # %cond.true |
| ; MIPS32-NEXT: lw $1, 12($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: j $BB2_4 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: $BB2_3: # %cond.false |
| ; MIPS32-NEXT: lw $1, 8($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: $BB2_4: # %cond.end |
| ; MIPS32-NEXT: lw $1, 4($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: move $2, $1 |
| ; MIPS32-NEXT: addiu $sp, $sp, 16 |
| ; MIPS32-NEXT: jr $ra |
| ; MIPS32-NEXT: nop |
| entry: |
| br i1 %cnd, label %cond.true, label %cond.false |
| |
| cond.true: |
| br label %cond.end |
| |
| cond.false: |
| br label %cond.end |
| |
| cond.end: |
| %cond = phi i16 [ %a, %cond.true ], [ %b, %cond.false ] |
| ret i16 %cond |
| } |
| |
| define i32 @test_i32(i1 %cnd, i32 %a, i32 %b) { |
| ; MIPS32-LABEL: test_i32: |
| ; MIPS32: # %bb.0: # %entry |
| ; MIPS32-NEXT: addiu $sp, $sp, -16 |
| ; MIPS32-NEXT: .cfi_def_cfa_offset 16 |
| ; MIPS32-NEXT: ori $1, $zero, 1 |
| ; MIPS32-NEXT: and $1, $4, $1 |
| ; MIPS32-NEXT: sw $5, 12($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: sw $6, 8($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: bnez $1, $BB3_2 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: # %bb.1: # %entry |
| ; MIPS32-NEXT: j $BB3_3 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: $BB3_2: # %cond.true |
| ; MIPS32-NEXT: lw $1, 12($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: j $BB3_4 |
| ; MIPS32-NEXT: nop |
| ; MIPS32-NEXT: $BB3_3: # %cond.false |
| ; MIPS32-NEXT: lw $1, 8($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill |
| ; MIPS32-NEXT: $BB3_4: # %cond.end |
| ; MIPS32-NEXT: lw $1, 4($sp) # 4-byte Folded Reload |
| ; MIPS32-NEXT: move $2, $1 |
| ; MIPS32-NEXT: addiu $sp, $sp, 16 |
| ; MIPS32-NEXT: jr $ra |
| ; MIPS32-NEXT: nop |
| entry: |
| br i1 %cnd, label %cond.true, label %cond.false |
| |
| cond.true: |
| br label %cond.end |
| |
| cond.false: |
| br label %cond.end |
| |
| cond.end: |
| %cond = phi i32 [ %a, %cond.true ], [ %b, %cond.false ] |
| ret i32 %cond |
| } |