2020-08-13 18:45:14 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2015-10-15 22:34:23 +08:00
|
|
|
; RUN: llc -march=mipsel -mattr=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=16
|
2012-10-18 06:29:54 +08:00
|
|
|
|
|
|
|
@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 {
|
2020-08-13 18:45:14 +08:00
|
|
|
; 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
|
2012-10-18 06:29:54 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load i32, i32* @i, align 4
|
|
|
|
%1 = load i32, i32* @j, align 4
|
2017-01-12 03:55:19 +08:00
|
|
|
%cmp = icmp sgt i32 %0, %1
|
|
|
|
br i1 %cmp, label %if.end, label %if.then
|
2012-10-18 06:29:54 +08:00
|
|
|
if.then: ; preds = %entry
|
|
|
|
store i32 1, i32* @result, align 4
|
|
|
|
br label %if.end
|
|
|
|
|
|
|
|
if.end: ; preds = %entry, %if.then
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
|