summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/select.ll
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-12-12 19:20:21 +0000
committerCraig Topper <craig.topper@intel.com>2018-12-12 19:20:21 +0000
commit4937adf75f024f5cbd3cc190d5bd57d1761aefc3 (patch)
treed7a7794e50161f74cfd6aa0c008d32296392121b /llvm/test/CodeGen/X86/select.ll
parent2ef6c46b2f9a2f9dce73d7b15bf837a2feb0bd8a (diff)
downloadbcm5719-llvm-4937adf75f024f5cbd3cc190d5bd57d1761aefc3.tar.gz
bcm5719-llvm-4937adf75f024f5cbd3cc190d5bd57d1761aefc3.zip
[X86] Emit SBB instead of SETCC_CARRY from LowerSELECT. Break false dependency on the SBB input.
I'm hoping we can just replace SETCC_CARRY with SBB. This is another step towards that. I've explicitly used zero as the input to the setcc to avoid a false dependency that we've had with the SETCC_CARRY. I changed one of the patterns that used NEG to instead use an explicit compare with 0 on the LHS. We needed the zero anyway to avoid the false dependency. The negate would clobber its input register. By using a CMP we can avoid that which could be useful. Differential Revision: https://reviews.llvm.org/D55414 llvm-svn: 348959
Diffstat (limited to 'llvm/test/CodeGen/X86/select.ll')
-rw-r--r--llvm/test/CodeGen/X86/select.ll46
1 files changed, 16 insertions, 30 deletions
diff --git a/llvm/test/CodeGen/X86/select.ll b/llvm/test/CodeGen/X86/select.ll
index f35da3b8b2c..947c9513720 100644
--- a/llvm/test/CodeGen/X86/select.ll
+++ b/llvm/test/CodeGen/X86/select.ll
@@ -624,21 +624,13 @@ define void @test8(i1 %c, <6 x i32>* %dst.addr, <6 x i32> %src1,<6 x i32> %src2)
;; Test integer select between values and constants.
define i64 @test9(i64 %x, i64 %y) nounwind readnone ssp noredzone {
-; GENERIC-LABEL: test9:
-; GENERIC: ## %bb.0:
-; GENERIC-NEXT: cmpq $1, %rdi
-; GENERIC-NEXT: sbbq %rax, %rax
-; GENERIC-NEXT: orq %rsi, %rax
-; GENERIC-NEXT: retq
-;
-; ATOM-LABEL: test9:
-; ATOM: ## %bb.0:
-; ATOM-NEXT: cmpq $1, %rdi
-; ATOM-NEXT: sbbq %rax, %rax
-; ATOM-NEXT: orq %rsi, %rax
-; ATOM-NEXT: nop
-; ATOM-NEXT: nop
-; ATOM-NEXT: retq
+; CHECK-LABEL: test9:
+; CHECK: ## %bb.0:
+; CHECK-NEXT: xorl %eax, %eax
+; CHECK-NEXT: cmpq $1, %rdi
+; CHECK-NEXT: sbbq %rax, %rax
+; CHECK-NEXT: orq %rsi, %rax
+; CHECK-NEXT: retq
;
; ATHLON-LABEL: test9:
; ATHLON: ## %bb.0:
@@ -672,21 +664,13 @@ define i64 @test9(i64 %x, i64 %y) nounwind readnone ssp noredzone {
;; Same as test9
define i64 @test9a(i64 %x, i64 %y) nounwind readnone ssp noredzone {
-; GENERIC-LABEL: test9a:
-; GENERIC: ## %bb.0:
-; GENERIC-NEXT: cmpq $1, %rdi
-; GENERIC-NEXT: sbbq %rax, %rax
-; GENERIC-NEXT: orq %rsi, %rax
-; GENERIC-NEXT: retq
-;
-; ATOM-LABEL: test9a:
-; ATOM: ## %bb.0:
-; ATOM-NEXT: cmpq $1, %rdi
-; ATOM-NEXT: sbbq %rax, %rax
-; ATOM-NEXT: orq %rsi, %rax
-; ATOM-NEXT: nop
-; ATOM-NEXT: nop
-; ATOM-NEXT: retq
+; CHECK-LABEL: test9a:
+; CHECK: ## %bb.0:
+; CHECK-NEXT: xorl %eax, %eax
+; CHECK-NEXT: cmpq $1, %rdi
+; CHECK-NEXT: sbbq %rax, %rax
+; CHECK-NEXT: orq %rsi, %rax
+; CHECK-NEXT: retq
;
; ATHLON-LABEL: test9a:
; ATHLON: ## %bb.0:
@@ -803,6 +787,7 @@ define i64 @test10(i64 %x, i64 %y) nounwind readnone ssp noredzone {
define i64 @test11(i64 %x, i64 %y) nounwind readnone ssp noredzone {
; CHECK-LABEL: test11:
; CHECK: ## %bb.0:
+; CHECK-NEXT: xorl %eax, %eax
; CHECK-NEXT: cmpq $1, %rdi
; CHECK-NEXT: sbbq %rax, %rax
; CHECK-NEXT: notq %rax
@@ -842,6 +827,7 @@ define i64 @test11(i64 %x, i64 %y) nounwind readnone ssp noredzone {
define i64 @test11a(i64 %x, i64 %y) nounwind readnone ssp noredzone {
; CHECK-LABEL: test11a:
; CHECK: ## %bb.0:
+; CHECK-NEXT: xorl %eax, %eax
; CHECK-NEXT: cmpq $1, %rdi
; CHECK-NEXT: sbbq %rax, %rax
; CHECK-NEXT: notq %rax
OpenPOWER on IntegriCloud