llvm.org GIT mirror llvm / 0e303e1
foo git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362451 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 3 months ago
1 changed file(s) with 74 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
11481148 }
11491149
11501150 declare void @bar()
1151
1152 define void @pr42118_i32(i32 %x) {
1153 ; X86-LABEL: pr42118_i32:
1154 ; X86: # %bb.0:
1155 ; X86-NEXT: blsrl {{[0-9]+}}(%esp), %eax
1156 ; X86-NEXT: jne .LBB48_1
1157 ; X86-NEXT: # %bb.2:
1158 ; X86-NEXT: jmp bar # TAILCALL
1159 ; X86-NEXT: .LBB48_1:
1160 ; X86-NEXT: retl
1161 ;
1162 ; X64-LABEL: pr42118_i32:
1163 ; X64: # %bb.0:
1164 ; X64-NEXT: blsrl %edi, %eax
1165 ; X64-NEXT: jne .LBB48_1
1166 ; X64-NEXT: # %bb.2:
1167 ; X64-NEXT: jmp bar # TAILCALL
1168 ; X64-NEXT: .LBB48_1:
1169 ; X64-NEXT: retq
1170 %tmp = sub i32 0, %x
1171 %tmp1 = and i32 %tmp, %x
1172 %cmp = icmp eq i32 %tmp1, %x
1173 br i1 %cmp, label %1, label %2
1174
1175 tail call void @bar()
1176 br label %2
1177
1178 ret void
1179 }
1180
1181 define void @pr42118_i64(i64 %x) {
1182 ; X86-LABEL: pr42118_i64:
1183 ; X86: # %bb.0:
1184 ; X86-NEXT: pushl %esi
1185 ; X86-NEXT: .cfi_def_cfa_offset 8
1186 ; X86-NEXT: .cfi_offset %esi, -8
1187 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1188 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
1189 ; X86-NEXT: movl %eax, %edx
1190 ; X86-NEXT: addl $-1, %edx
1191 ; X86-NEXT: movl %ecx, %esi
1192 ; X86-NEXT: adcl $-1, %esi
1193 ; X86-NEXT: andl %eax, %edx
1194 ; X86-NEXT: andl %ecx, %esi
1195 ; X86-NEXT: orl %edx, %esi
1196 ; X86-NEXT: jne .LBB49_1
1197 ; X86-NEXT: # %bb.2:
1198 ; X86-NEXT: popl %esi
1199 ; X86-NEXT: .cfi_def_cfa_offset 4
1200 ; X86-NEXT: jmp bar # TAILCALL
1201 ; X86-NEXT: .LBB49_1:
1202 ; X86-NEXT: .cfi_def_cfa_offset 8
1203 ; X86-NEXT: popl %esi
1204 ; X86-NEXT: .cfi_def_cfa_offset 4
1205 ; X86-NEXT: retl
1206 ;
1207 ; X64-LABEL: pr42118_i64:
1208 ; X64: # %bb.0:
1209 ; X64-NEXT: blsrq %rdi, %rax
1210 ; X64-NEXT: jne .LBB49_1
1211 ; X64-NEXT: # %bb.2:
1212 ; X64-NEXT: jmp bar # TAILCALL
1213 ; X64-NEXT: .LBB49_1:
1214 ; X64-NEXT: retq
1215 %tmp = sub i64 0, %x
1216 %tmp1 = and i64 %tmp, %x
1217 %cmp = icmp eq i64 %tmp1, %x
1218 br i1 %cmp, label %1, label %2
1219
1220 tail call void @bar()
1221 br label %2
1222
1223 ret void
1224 }