diff options
author | Craig Topper <craig.topper@intel.com> | 2018-12-21 21:42:43 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-12-21 21:42:43 +0000 |
commit | e58cd9cbc6f5039a45da77713eb68977f01c9f31 (patch) | |
tree | 347412a7bcb652a3696553c12a7c8285bb579da0 /llvm/test/CodeGen/X86/tbm_patterns.ll | |
parent | c6027e20d4b6756833e1692baeec78c9a5ff4e5e (diff) | |
download | bcm5719-llvm-e58cd9cbc6f5039a45da77713eb68977f01c9f31.tar.gz bcm5719-llvm-e58cd9cbc6f5039a45da77713eb68977f01c9f31.zip |
[X86] Add isel patterns to match BMI/TBMI instructions when lowering has turned the root nodes into one of the flag producing binops.
This fixes the patterns that have or/and as a root. 'and' is handled differently since thy usually have a CMP wrapped around them.
I had to look for uses of the CF flag because all these nodes have non-standard CF flag behavior. A real or/xor would always clear CF. In practice we shouldn't be using the CF flag from these nodes as far as I know.
Differential Revision: https://reviews.llvm.org/D55813
llvm-svn: 349962
Diffstat (limited to 'llvm/test/CodeGen/X86/tbm_patterns.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/tbm_patterns.ll | 50 |
1 files changed, 12 insertions, 38 deletions
diff --git a/llvm/test/CodeGen/X86/tbm_patterns.ll b/llvm/test/CodeGen/X86/tbm_patterns.ll index 65cc92ca853..f7bfb5bec8c 100644 --- a/llvm/test/CodeGen/X86/tbm_patterns.ll +++ b/llvm/test/CodeGen/X86/tbm_patterns.ll @@ -226,10 +226,7 @@ define i32 @test_x86_tbm_blci_u32_z2(i32 %a, i32 %b, i32 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_blci_u32_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movl %esi, %eax -; CHECK-NEXT: # kill: def $edi killed $edi def $rdi -; CHECK-NEXT: leal 1(%rdi), %ecx -; CHECK-NEXT: notl %ecx -; CHECK-NEXT: orl %edi, %ecx +; CHECK-NEXT: blcil %edi, %ecx ; CHECK-NEXT: cmovnel %edx, %eax ; CHECK-NEXT: retq %t0 = add i32 1, %a @@ -269,9 +266,7 @@ define i64 @test_x86_tbm_blci_u64_z2(i64 %a, i64 %b, i64 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_blci_u64_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movq %rsi, %rax -; CHECK-NEXT: leaq 1(%rdi), %rcx -; CHECK-NEXT: notq %rcx -; CHECK-NEXT: orq %rdi, %rcx +; CHECK-NEXT: blciq %rdi, %rcx ; CHECK-NEXT: cmovneq %rdx, %rax ; CHECK-NEXT: retq %t0 = add i64 1, %a @@ -409,9 +404,7 @@ define i32 @test_x86_tbm_blcmsk_u32_z2(i32 %a, i32 %b, i32 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_blcmsk_u32_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movl %esi, %eax -; CHECK-NEXT: # kill: def $edi killed $edi def $rdi -; CHECK-NEXT: leal 1(%rdi), %ecx -; CHECK-NEXT: xorl %edi, %ecx +; CHECK-NEXT: blcmskl %edi, %ecx ; CHECK-NEXT: cmovnel %edx, %eax ; CHECK-NEXT: retq %t0 = add i32 %a, 1 @@ -448,8 +441,7 @@ define i64 @test_x86_tbm_blcmsk_u64_z2(i64 %a, i64 %b, i64 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_blcmsk_u64_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movq %rsi, %rax -; CHECK-NEXT: leaq 1(%rdi), %rcx -; CHECK-NEXT: xorq %rdi, %rcx +; CHECK-NEXT: blcmskq %rdi, %rcx ; CHECK-NEXT: cmovneq %rdx, %rax ; CHECK-NEXT: retq %t0 = add i64 %a, 1 @@ -486,9 +478,7 @@ define i32 @test_x86_tbm_blcs_u32_z2(i32 %a, i32 %b, i32 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_blcs_u32_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movl %esi, %eax -; CHECK-NEXT: # kill: def $edi killed $edi def $rdi -; CHECK-NEXT: leal 1(%rdi), %ecx -; CHECK-NEXT: orl %edi, %ecx +; CHECK-NEXT: blcsl %edi, %ecx ; CHECK-NEXT: cmovnel %edx, %eax ; CHECK-NEXT: retq %t0 = add i32 %a, 1 @@ -525,8 +515,7 @@ define i64 @test_x86_tbm_blcs_u64_z2(i64 %a, i64 %b, i64 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_blcs_u64_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movq %rsi, %rax -; CHECK-NEXT: leaq 1(%rdi), %rcx -; CHECK-NEXT: orq %rdi, %rcx +; CHECK-NEXT: blcsq %rdi, %rcx ; CHECK-NEXT: cmovneq %rdx, %rax ; CHECK-NEXT: retq %t0 = add i64 %a, 1 @@ -563,9 +552,7 @@ define i32 @test_x86_tbm_blsfill_u32_z2(i32 %a, i32 %b, i32 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_blsfill_u32_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movl %esi, %eax -; CHECK-NEXT: # kill: def $edi killed $edi def $rdi -; CHECK-NEXT: leal -1(%rdi), %ecx -; CHECK-NEXT: orl %edi, %ecx +; CHECK-NEXT: blsfilll %edi, %ecx ; CHECK-NEXT: cmovnel %edx, %eax ; CHECK-NEXT: retq %t0 = add i32 %a, -1 @@ -602,8 +589,7 @@ define i64 @test_x86_tbm_blsfill_u64_z2(i64 %a, i64 %b, i64 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_blsfill_u64_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movq %rsi, %rax -; CHECK-NEXT: leaq -1(%rdi), %rcx -; CHECK-NEXT: orq %rdi, %rcx +; CHECK-NEXT: blsfillq %rdi, %rcx ; CHECK-NEXT: cmovneq %rdx, %rax ; CHECK-NEXT: retq %t0 = add i64 %a, -1 @@ -642,10 +628,7 @@ define i32 @test_x86_tbm_blsic_u32_z2(i32 %a, i32 %b, i32 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_blsic_u32_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movl %esi, %eax -; CHECK-NEXT: movl %edi, %ecx -; CHECK-NEXT: notl %ecx -; CHECK-NEXT: decl %edi -; CHECK-NEXT: orl %ecx, %edi +; CHECK-NEXT: blsicl %edi, %ecx ; CHECK-NEXT: cmovnel %edx, %eax ; CHECK-NEXT: retq %t0 = xor i32 %a, -1 @@ -685,10 +668,7 @@ define i64 @test_x86_tbm_blsic_u64_z2(i64 %a, i64 %b, i64 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_blsic_u64_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movq %rsi, %rax -; CHECK-NEXT: movq %rdi, %rcx -; CHECK-NEXT: notq %rcx -; CHECK-NEXT: decq %rdi -; CHECK-NEXT: orq %rcx, %rdi +; CHECK-NEXT: blsicq %rdi, %rcx ; CHECK-NEXT: cmovneq %rdx, %rax ; CHECK-NEXT: retq %t0 = xor i64 %a, -1 @@ -728,10 +708,7 @@ define i32 @test_x86_tbm_t1mskc_u32_z2(i32 %a, i32 %b, i32 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_t1mskc_u32_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movl %esi, %eax -; CHECK-NEXT: movl %edi, %ecx -; CHECK-NEXT: notl %ecx -; CHECK-NEXT: incl %edi -; CHECK-NEXT: orl %ecx, %edi +; CHECK-NEXT: t1mskcl %edi, %ecx ; CHECK-NEXT: cmovnel %edx, %eax ; CHECK-NEXT: retq %t0 = xor i32 %a, -1 @@ -771,10 +748,7 @@ define i64 @test_x86_tbm_t1mskc_u64_z2(i64 %a, i64 %b, i64 %c) nounwind { ; CHECK-LABEL: test_x86_tbm_t1mskc_u64_z2: ; CHECK: # %bb.0: ; CHECK-NEXT: movq %rsi, %rax -; CHECK-NEXT: movq %rdi, %rcx -; CHECK-NEXT: notq %rcx -; CHECK-NEXT: incq %rdi -; CHECK-NEXT: orq %rcx, %rdi +; CHECK-NEXT: t1mskcq %rdi, %rcx ; CHECK-NEXT: cmovneq %rdx, %rax ; CHECK-NEXT: retq %t0 = xor i64 %a, -1 |