From 4bf60538fdb2b6bcdd1df39b1b89a1ad1c1143e0 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 9 Aug 2019 03:08:54 +0000 Subject: [PATCH] [X86] Simplify ReplaceNodeResults handling for SIGN_EXTEND/ZERO_EXTEND/TRUNCATE for vectors to only handle widening. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368386 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 2efa01156bb..b9c93ad335d 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -27633,8 +27633,8 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N, } case ISD::TRUNCATE: { MVT VT = N->getSimpleValueType(0); - if (getTypeAction(*DAG.getContext(), VT) != TypeWidenVector) - return; + assert(getTypeAction(*DAG.getContext(), VT) == TypeWidenVector && + "Unexpected type action!"); // The generic legalizer will try to widen the input type to the same // number of elements as the widened result type. But this isn't always @@ -27688,8 +27688,9 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N, SDValue In = N->getOperand(0); EVT InVT = In.getValueType(); if (!Subtarget.hasSSE41() && VT == MVT::v4i64 && - (InVT == MVT::v4i16 || InVT == MVT::v4i8) && - getTypeAction(*DAG.getContext(), InVT) == TypeWidenVector) { + (InVT == MVT::v4i16 || InVT == MVT::v4i8)){ + assert(getTypeAction(*DAG.getContext(), InVT) == TypeWidenVector && + "Unexpected type action!"); assert(N->getOpcode() == ISD::SIGN_EXTEND && "Unexpected opcode"); // Custom split this so we can extend i8/i16->i32 invec. This is better // since sign_extend_inreg i8/i16->i64 requires an extend to i32 using -- 2.40.0