1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL
4 define i8 @test_i8(i32 %a, i8 %f, i8 %t) {
6 ; ALL: # %bb.0: # %entry
7 ; ALL-NEXT: xorl %ecx, %ecx
8 ; ALL-NEXT: cmpl %ecx, %edi
10 ; ALL-NEXT: testb $1, %cl
11 ; ALL-NEXT: je .LBB0_2
13 ; ALL-NEXT: movl %esi, %eax
14 ; ALL-NEXT: # kill: def $al killed $al killed $eax
16 ; ALL-NEXT: .LBB0_2: # %cond.false
17 ; ALL-NEXT: movl %edx, %eax
18 ; ALL-NEXT: # kill: def $al killed $al killed $eax
21 %cmp = icmp sgt i32 %a, 0
22 br i1 %cmp, label %cond.true, label %cond.false
24 cond.true: ; preds = %entry
27 cond.false: ; preds = %entry
30 cond.end: ; preds = %cond.false, %cond.true
31 %cond = phi i8 [ %f, %cond.true ], [ %t, %cond.false ]
35 define i16 @test_i16(i32 %a, i16 %f, i16 %t) {
36 ; ALL-LABEL: test_i16:
37 ; ALL: # %bb.0: # %entry
38 ; ALL-NEXT: xorl %ecx, %ecx
39 ; ALL-NEXT: cmpl %ecx, %edi
41 ; ALL-NEXT: testb $1, %cl
42 ; ALL-NEXT: je .LBB1_2
44 ; ALL-NEXT: movl %esi, %eax
45 ; ALL-NEXT: # kill: def $ax killed $ax killed $eax
47 ; ALL-NEXT: .LBB1_2: # %cond.false
48 ; ALL-NEXT: movl %edx, %eax
49 ; ALL-NEXT: # kill: def $ax killed $ax killed $eax
52 %cmp = icmp sgt i32 %a, 0
53 br i1 %cmp, label %cond.true, label %cond.false
55 cond.true: ; preds = %entry
58 cond.false: ; preds = %entry
61 cond.end: ; preds = %cond.false, %cond.true
62 %cond = phi i16 [ %f, %cond.true ], [ %t, %cond.false ]
66 define i32 @test_i32(i32 %a, i32 %f, i32 %t) {
67 ; ALL-LABEL: test_i32:
68 ; ALL: # %bb.0: # %entry
69 ; ALL-NEXT: movl %esi, %eax
70 ; ALL-NEXT: xorl %ecx, %ecx
71 ; ALL-NEXT: cmpl %ecx, %edi
73 ; ALL-NEXT: testb $1, %cl
74 ; ALL-NEXT: jne .LBB2_2
75 ; ALL-NEXT: # %bb.1: # %cond.false
76 ; ALL-NEXT: movl %edx, %eax
77 ; ALL-NEXT: .LBB2_2: # %cond.end
80 %cmp = icmp sgt i32 %a, 0
81 br i1 %cmp, label %cond.true, label %cond.false
83 cond.true: ; preds = %entry
86 cond.false: ; preds = %entry
89 cond.end: ; preds = %cond.false, %cond.true
90 %cond = phi i32 [ %f, %cond.true ], [ %t, %cond.false ]
94 define i64 @test_i64(i32 %a, i64 %f, i64 %t) {
95 ; ALL-LABEL: test_i64:
96 ; ALL: # %bb.0: # %entry
97 ; ALL-NEXT: movq %rsi, %rax
98 ; ALL-NEXT: xorl %ecx, %ecx
99 ; ALL-NEXT: cmpl %ecx, %edi
101 ; ALL-NEXT: testb $1, %cl
102 ; ALL-NEXT: jne .LBB3_2
103 ; ALL-NEXT: # %bb.1: # %cond.false
104 ; ALL-NEXT: movq %rdx, %rax
105 ; ALL-NEXT: .LBB3_2: # %cond.end
108 %cmp = icmp sgt i32 %a, 0
109 br i1 %cmp, label %cond.true, label %cond.false
111 cond.true: ; preds = %entry
114 cond.false: ; preds = %entry
117 cond.end: ; preds = %cond.false, %cond.true
118 %cond = phi i64 [ %f, %cond.true ], [ %t, %cond.false ]
122 define float @test_float(i32 %a, float %f, float %t) {
123 ; ALL-LABEL: test_float:
124 ; ALL: # %bb.0: # %entry
125 ; ALL-NEXT: xorl %eax, %eax
126 ; ALL-NEXT: cmpl %eax, %edi
128 ; ALL-NEXT: testb $1, %al
129 ; ALL-NEXT: jne .LBB4_2
130 ; ALL-NEXT: # %bb.1: # %cond.false
131 ; ALL-NEXT: movaps %xmm1, %xmm0
132 ; ALL-NEXT: .LBB4_2: # %cond.end
135 %cmp = icmp sgt i32 %a, 0
136 br i1 %cmp, label %cond.true, label %cond.false
138 cond.true: ; preds = %entry
141 cond.false: ; preds = %entry
144 cond.end: ; preds = %cond.false, %cond.true
145 %cond = phi float [ %f, %cond.true ], [ %t, %cond.false ]
149 define double @test_double(i32 %a, double %f, double %t) {
150 ; ALL-LABEL: test_double:
151 ; ALL: # %bb.0: # %entry
152 ; ALL-NEXT: xorl %eax, %eax
153 ; ALL-NEXT: cmpl %eax, %edi
155 ; ALL-NEXT: testb $1, %al
156 ; ALL-NEXT: jne .LBB5_2
157 ; ALL-NEXT: # %bb.1: # %cond.false
158 ; ALL-NEXT: movaps %xmm1, %xmm0
159 ; ALL-NEXT: .LBB5_2: # %cond.end
162 %cmp = icmp sgt i32 %a, 0
163 br i1 %cmp, label %cond.true, label %cond.false
165 cond.true: ; preds = %entry
168 cond.false: ; preds = %entry
171 cond.end: ; preds = %cond.false, %cond.true
172 %cond = phi double [ %f, %cond.true ], [ %t, %cond.false ]