diff options
author | Michael Liao <michael.liao@intel.com> | 2013-10-15 17:51:58 +0000 |
---|---|---|
committer | Michael Liao <michael.liao@intel.com> | 2013-10-15 17:51:58 +0000 |
commit | bfa7b1e6955ce3cc83214c253696470cef6db179 (patch) | |
tree | 523f13ce40247817d9ef32978d2fb04343dc8d20 /lib | |
parent | dc8c044a9a3e00cab52ca204717de7aee9dab1be (diff) | |
download | external_llvm-bfa7b1e6955ce3cc83214c253696470cef6db179.zip external_llvm-bfa7b1e6955ce3cc83214c253696470cef6db179.tar.gz external_llvm-bfa7b1e6955ce3cc83214c253696470cef6db179.tar.bz2 |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
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())); |