summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-01-08 15:53:40 +0000
committerSanjay Patel <spatel@rotateright.com>2017-01-08 15:53:40 +0000
commitbf51c8a975621c6c275612bfe6d7b8d833c6b83b (patch)
tree56eea9b17d69e26cc37a6d5d4c9ba3f7e08f2ce0 /llvm/test
parent9c58950eeb0ac0ffe86b0ebdd43b2042d4fb9de6 (diff)
downloadbcm5719-llvm-bf51c8a975621c6c275612bfe6d7b8d833c6b83b.tar.gz
bcm5719-llvm-bf51c8a975621c6c275612bfe6d7b8d833c6b83b.zip
[x86] fix usage of stale operands when lowering select
I noticed this problem as part of the ongoing attempt to canonicalize min/max ops in IR. The debug output shows nodes like this: t4: i32 = xor t2, Constant:i32<-1> t21: i8 = setcc t4, Constant:i32<0>, setlt:ch t14: i32 = select t21, t4, Constant:i32<-1> And because the select is holding onto the t4 (xor) node while EmitTest creates a new x86-specific xor node, the lowering results in: t4: i32 = xor t2, Constant:i32<-1> t25: i32,i32 = X86ISD::XOR t2, Constant:i32<-1> t28: i32,glue = X86ISD::CMOV Constant:i32<-1>, t4, Constant:i8<15>, t25:1 Differential Revision: https://reviews.llvm.org/D28374 llvm-svn: 291392
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/cmov.ll6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/test/CodeGen/X86/cmov.ll b/llvm/test/CodeGen/X86/cmov.ll
index 8e9bc8b5af4..0060539c691 100644
--- a/llvm/test/CodeGen/X86/cmov.ll
+++ b/llvm/test/CodeGen/X86/cmov.ll
@@ -157,16 +157,12 @@ define i8 @test7(i1 inreg %c, i8 inreg %a, i8 inreg %b) nounwind {
ret i8 %d
}
-; FIXME: The 'not' is redundant.
-
define i32 @smin(i32 %x) {
; CHECK-LABEL: smin:
; CHECK: ## BB#0:
-; CHECK-NEXT: movl %edi, %ecx
-; CHECK-NEXT: notl %ecx
; CHECK-NEXT: xorl $-1, %edi
; CHECK-NEXT: movl $-1, %eax
-; CHECK-NEXT: cmovsl %ecx, %eax
+; CHECK-NEXT: cmovsl %edi, %eax
; CHECK-NEXT: retq
%not_x = xor i32 %x, -1
%1 = icmp slt i32 %not_x, -1
OpenPOWER on IntegriCloud