1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[x86] add test to show bug in select lowering; NFC

llvm-svn: 291151
This commit is contained in:
Sanjay Patel 2017-01-05 18:35:44 +00:00
parent 87a1dcdf6d
commit a376165489

View File

@ -156,3 +156,21 @@ define i8 @test7(i1 inreg %c, i8 inreg %a, i8 inreg %b) nounwind {
%d = select i1 %c, i8 %a, i8 %b
ret i8 %d
}
; FIXME: The 'not' is redundant.
define i32 @smin(i32 %x) {
; CHECK-LABEL: smin:
; CHECK: ## BB#0:
; CHECK-NEXT: movl %edi, %ecx
; CHECK-NEXT: notl %ecx
; CHECK-NEXT: xorl $-1, %edi
; CHECK-NEXT: movl $-1, %eax
; CHECK-NEXT: cmovsl %ecx, %eax
; CHECK-NEXT: retq
%not_x = xor i32 %x, -1
%1 = icmp slt i32 %not_x, -1
%sel = select i1 %1, i32 %not_x, i32 -1
ret i32 %sel
}