summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-06-06 21:08:55 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-06-06 21:08:55 +0000
commitd0700b29195b72c3af8dc8f05dfb6ed04ca3e907 (patch)
treec0750c870807f77dd1f7e56b2d811900e3f5b33d /llvm/test/CodeGen
parent2c8dda4e53a305566bfd92967166ffe68d53851b (diff)
downloadbcm5719-llvm-d0700b29195b72c3af8dc8f05dfb6ed04ca3e907.tar.gz
bcm5719-llvm-d0700b29195b72c3af8dc8f05dfb6ed04ca3e907.zip
X86: Don't turn shifts into ands if there's another use that may not check for equality.
Fixes PR19964. llvm-svn: 210371
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/X86/cmp.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/cmp.ll b/llvm/test/CodeGen/X86/cmp.ll
index cdcdc963ed1..149d53759fe 100644
--- a/llvm/test/CodeGen/X86/cmp.ll
+++ b/llvm/test/CodeGen/X86/cmp.ll
@@ -198,3 +198,16 @@ define i32 @test14(i32 %mask, i32 %base, i32 %intra) #0 {
; CHECK: shrl $7, %edi
; CHECK-NEXT: cmovnsl %edx, %esi
}
+
+; PR19964
+define zeroext i1 @test15(i32 %bf.load, i32 %n) {
+ %bf.lshr = lshr i32 %bf.load, 16
+ %cmp2 = icmp eq i32 %bf.lshr, 0
+ %cmp5 = icmp uge i32 %bf.lshr, %n
+ %.cmp5 = or i1 %cmp2, %cmp5
+ ret i1 %.cmp5
+
+; CHECK-LABEL: test15:
+; CHECK: shrl $16, %edi
+; CHECK: cmpl %esi, %edi
+}
OpenPOWER on IntegriCloud