llvm-project/llvm/test/CodeGen/Mips/brcongt.ll

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.3 KiB
LLVM
Raw Normal View History

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -march=mipsel -mattr=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=16
@i = global i32 5, align 4
@j = global i32 10, align 4
@k = global i32 5, align 4
@result = global i32 0, align 4
define void @test() nounwind {
; 16-LABEL: test:
; 16: # %bb.0: # %entry
; 16-NEXT: lui $2, %hi(_gp_disp)
; 16-NEXT: addiu $2, $2, %lo(_gp_disp)
; 16-NEXT: li $2, %hi(_gp_disp)
; 16-NEXT: addiu $3, $pc, %lo(_gp_disp)
; 16-NEXT: sll $2, $2, 16
; 16-NEXT: addu $2, $3, $2
; 16-NEXT: lw $3, %got(i)($2)
; 16-NEXT: lw $4, %got(j)($2)
; 16-NEXT: lw $3, 0($3)
; 16-NEXT: lw $4, 0($4)
; 16-NEXT: slt $4, $3
; 16-NEXT: bteqz $BB0_2 # 16 bit inst
; 16-NEXT: # %bb.1: # %if.end
; 16-NEXT: jrc $ra
; 16-NEXT: $BB0_2: # %if.then
; 16-NEXT: lw $2, %got(result)($2)
; 16-NEXT: li $3, 1
; 16-NEXT: sw $3, 0($2)
; 16-NEXT: jrc $ra
entry:
%0 = load i32, i32* @i, align 4
%1 = load i32, i32* @j, align 4
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.end, label %if.then
if.then: ; preds = %entry
store i32 1, i32* @result, align 4
br label %if.end
if.end: ; preds = %entry, %if.then
ret void
}