aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Mips/zeroreg.ll
blob: b890e1dba9fcb9bde6c0522c89a6b81edced0fea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
; RUN: llc < %s -march=mipsel | FileCheck %s

@g1 = external global i32

define i32 @foo0(i32 %s) nounwind readonly {
entry:
; CHECK-NOT: addiu
; CHECK:     movn
  %tobool = icmp ne i32 %s, 0
  %0 = load i32* @g1, align 4, !tbaa !0
  %cond = select i1 %tobool, i32 0, i32 %0
  ret i32 %cond
}

define i32 @foo1(i32 %s) nounwind readonly {
entry:
; CHECK-NOT: addiu
; CHECK:     movz
  %tobool = icmp ne i32 %s, 0
  %0 = load i32* @g1, align 4, !tbaa !0
  %cond = select i1 %tobool, i32 %0, i32 0
  ret i32 %cond
}

!0 = metadata !{metadata !"int", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA", null}