From 1ef6c59b1d2fe92dd842a68a037c34d5880e1460 Mon Sep 17 00:00:00 2001 From: Michael Kuperstein Date: Wed, 6 Jul 2016 21:56:18 +0000 Subject: [X86] Transform setcc + movzbl into xorl + setcc xorl + setcc is generally the preferred sequence due to the partial register stall setcc + movzbl suffers from. As a bonus, it also encodes one byte smaller. This fixes PR28146. Differential Revision: http://reviews.llvm.org/D21774 llvm-svn: 274692 --- llvm/test/CodeGen/X86/bmi.ll | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/test/CodeGen/X86/bmi.ll') diff --git a/llvm/test/CodeGen/X86/bmi.ll b/llvm/test/CodeGen/X86/bmi.ll index c79a6374226..10b1f51e3da 100644 --- a/llvm/test/CodeGen/X86/bmi.ll +++ b/llvm/test/CodeGen/X86/bmi.ll @@ -201,7 +201,6 @@ define i1 @and_cmp_const_power_of_two(i32 %x, i32 %y) { ; CHECK-NEXT: btl %esi, %edi ; CHECK-NEXT: setae %al ; CHECK-NEXT: retq -; %shl = shl i32 1, %y %and = and i32 %x, %shl %cmp = icmp ne i32 %and, %shl @@ -213,12 +212,11 @@ define i32 @and_cmp_not_one_use(i32 %x) { ; CHECK-LABEL: and_cmp_not_one_use: ; CHECK: # BB#0: ; CHECK-NEXT: andl $37, %edi +; CHECK-NEXT: xorl %eax, %eax ; CHECK-NEXT: cmpl $37, %edi ; CHECK-NEXT: sete %al -; CHECK-NEXT: movzbl %al, %eax ; CHECK-NEXT: addl %edi, %eax ; CHECK-NEXT: retq -; %and = and i32 %x, 37 %cmp = icmp eq i32 %and, 37 %ext = zext i1 %cmp to i32 -- cgit v1.2.3