From bfa7b1e6955ce3cc83214c253696470cef6db179 Mon Sep 17 00:00:00 2001 From: Michael Liao Date: Tue, 15 Oct 2013 17:51:58 +0000 Subject: Fix PR17546 - Type of index used in extract_vector_elt or insert_vector_elt supposes to be TLI.getVectorIdxTy() which is pointer type on most targets. It'd better to truncate (or zero-extend in case it's changed later) it to mask element type to guarantee they are matching instead of asserting that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192722 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 8e3a4d7..54d8244 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -7627,12 +7627,7 @@ X86TargetLowering::LowerEXTRACT_VECTOR_ELT(SDValue Op, MVT MaskVT = MVT::getVectorVT(MaskEltVT, VecVT.getSizeInBits() / MaskEltVT.getSizeInBits()); - if (Idx.getSimpleValueType() != MaskEltVT) - if (Idx.getOpcode() == ISD::ZERO_EXTEND || - Idx.getOpcode() == ISD::SIGN_EXTEND) - Idx = Idx.getOperand(0); - assert(Idx.getSimpleValueType() == MaskEltVT && - "Unexpected index in insertelement"); + Idx = DAG.getZExtOrTrunc(Idx, dl, MaskEltVT); SDValue Mask = DAG.getNode(X86ISD::VINSERT, dl, MaskVT, getZeroVector(MaskVT, Subtarget, DAG, dl), Idx, DAG.getConstant(0, getPointerTy())); -- cgit v1.1