From 70d05d486ef2c4af5edff0820278ebd14820a325 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316457 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 1 + test/CodeGen/X86/avx512-cvt.ll | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index b6e3efe60c2..0825926cb53 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/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/test/CodeGen/X86/avx512-cvt.ll b/test/CodeGen/X86/avx512-cvt.ll index 6934a3bbb09..fa84a640eb5 100644 --- a/test/CodeGen/X86/avx512-cvt.ll +++ b/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 -- 2.40.0