summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/bmi.ll
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-06-20 17:52:53 +0000
committerCraig Topper <craig.topper@intel.com>2019-06-20 17:52:53 +0000
commit9e1665f2d61ee52d06226682860af5da0c042e82 (patch)
tree1b814514d453581e085bdfae816dc73bdfe83477 /llvm/test/CodeGen/X86/bmi.ll
parent63311bfb8334c8365f959b2a4af2f0563327ab97 (diff)
downloadbcm5719-llvm-9e1665f2d61ee52d06226682860af5da0c042e82.tar.gz
bcm5719-llvm-9e1665f2d61ee52d06226682860af5da0c042e82.zip
[X86] Add BLSI to isUseDefConvertible.
Summary: BLSI sets the C flag is the input is not zero. So if its followed by a TEST of the input where only the Z flag is consumed, we can replace it with the opposite check of the C flag. We should be able to do the same for BLSMSK and BLSR, but the naive test case for those is being optimized to a subo by CodeGenPrepare. Reviewers: spatel, RKSimon Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63589 llvm-svn: 363957
Diffstat (limited to 'llvm/test/CodeGen/X86/bmi.ll')
-rw-r--r--llvm/test/CodeGen/X86/bmi.ll6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/test/CodeGen/X86/bmi.ll b/llvm/test/CodeGen/X86/bmi.ll
index cdad570226c..f71ed7685c6 100644
--- a/llvm/test/CodeGen/X86/bmi.ll
+++ b/llvm/test/CodeGen/X86/bmi.ll
@@ -1240,8 +1240,7 @@ define i32 @blsi_cflag_32(i32 %x, i32 %y) nounwind {
; X64-LABEL: blsi_cflag_32:
; X64: # %bb.0:
; X64-NEXT: blsil %edi, %eax
-; X64-NEXT: testl %edi, %edi
-; X64-NEXT: cmovel %esi, %eax
+; X64-NEXT: cmovael %esi, %eax
; X64-NEXT: retq
%tobool = icmp eq i32 %x, 0
%sub = sub nsw i32 0, %x
@@ -1279,8 +1278,7 @@ define i64 @blsi_cflag_64(i64 %x, i64 %y) nounwind {
; X64-LABEL: blsi_cflag_64:
; X64: # %bb.0:
; X64-NEXT: blsiq %rdi, %rax
-; X64-NEXT: testq %rdi, %rdi
-; X64-NEXT: cmoveq %rsi, %rax
+; X64-NEXT: cmovaeq %rsi, %rax
; X64-NEXT: retq
%tobool = icmp eq i64 %x, 0
%sub = sub nsw i64 0, %x
OpenPOWER on IntegriCloud