From 1bc62f03a58616cb505805cf271f3bcee18d66eb Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 24 Oct 2017 16:38:38 +0000 Subject: [PATCH] [SelectionDAG] Add VSELECT support to ComputeNumSignBits llvm-svn: 316457 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 1 + llvm/test/CodeGen/X86/avx512-cvt.ll | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index b6e3efe60c2e..0825926cb53e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3109,6 +3109,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts, break; case ISD::SELECT: + case ISD::VSELECT: Tmp = ComputeNumSignBits(Op.getOperand(1), Depth+1); if (Tmp == 1) return 1; // Early out. Tmp2 = ComputeNumSignBits(Op.getOperand(2), Depth+1); diff --git a/llvm/test/CodeGen/X86/avx512-cvt.ll b/llvm/test/CodeGen/X86/avx512-cvt.ll index 6934a3bbb09d..fa84a640eb54 100644 --- a/llvm/test/CodeGen/X86/avx512-cvt.ll +++ b/llvm/test/CodeGen/X86/avx512-cvt.ll @@ -1685,9 +1685,9 @@ define <2 x double> @sbto2f64(<2 x double> %a) { ; VLNODQ-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0 ; VLNODQ-NEXT: vmovdqa64 %xmm0, %xmm0 {%k1} {z} ; VLNODQ-NEXT: vpextrq $1, %xmm0, %rax -; VLNODQ-NEXT: vcvtsi2sdq %rax, %xmm2, %xmm1 +; VLNODQ-NEXT: vcvtsi2sdl %eax, %xmm2, %xmm1 ; VLNODQ-NEXT: vmovq %xmm0, %rax -; VLNODQ-NEXT: vcvtsi2sdq %rax, %xmm2, %xmm0 +; VLNODQ-NEXT: vcvtsi2sdl %eax, %xmm2, %xmm0 ; VLNODQ-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0] ; VLNODQ-NEXT: retq %cmpres = fcmp ogt <2 x double> %a, zeroinitializer