summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/bmi.ll
diff options
context:
space:
mode:
authorMichael Kuperstein <mkuper@google.com>2016-07-06 21:56:18 +0000
committerMichael Kuperstein <mkuper@google.com>2016-07-06 21:56:18 +0000
commit1ef6c59b1d2fe92dd842a68a037c34d5880e1460 (patch)
tree9d9225c98667736640ff47bca4951d7160e7267a /llvm/test/CodeGen/X86/bmi.ll
parent0a53fdf00cc42596e6354fbd2a3490defd0f6272 (diff)
downloadbcm5719-llvm-1ef6c59b1d2fe92dd842a68a037c34d5880e1460.tar.gz
bcm5719-llvm-1ef6c59b1d2fe92dd842a68a037c34d5880e1460.zip
[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
Diffstat (limited to 'llvm/test/CodeGen/X86/bmi.ll')
-rw-r--r--llvm/test/CodeGen/X86/bmi.ll4
1 files changed, 1 insertions, 3 deletions
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
OpenPOWER on IntegriCloud