[llvm] r291151 - [x86] add test to show bug in select lowering; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 5 10:35:44 PST 2017
Author: spatel
Date: Thu Jan 5 12:35:44 2017
New Revision: 291151
URL: http://llvm.org/viewvc/llvm-project?rev=291151&view=rev
Log:
[x86] add test to show bug in select lowering; NFC
Modified:
llvm/trunk/test/CodeGen/X86/cmov.ll
Modified: llvm/trunk/test/CodeGen/X86/cmov.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmov.ll?rev=291151&r1=291150&r2=291151&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/cmov.ll (original)
+++ llvm/trunk/test/CodeGen/X86/cmov.ll Thu Jan 5 12:35:44 2017
@@ -156,3 +156,21 @@ define i8 @test7(i1 inreg %c, i8 inreg %
%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
+}
+
More information about the llvm-commits
mailing list