diff options
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 7 | ||||
-rw-r--r-- | test/CodeGen/X86/pr17546.ll | 10 |
2 files changed, 11 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())); diff --git a/test/CodeGen/X86/pr17546.ll b/test/CodeGen/X86/pr17546.ll new file mode 100644 index 0000000..174fa5c --- /dev/null +++ b/test/CodeGen/X86/pr17546.ll @@ -0,0 +1,10 @@ +; RUN: llc < %s -mtriple=x86_64-linux-gnu -mcpu=core-avx2 | FileCheck %s + +define i32 @f_f___un_3C_unf_3E_un_3C_unf_3E_(<8 x i32> %__mask, i64 %BBBB) { + %QQQ = trunc i64 %BBBB to i32 + %1 = extractelement <8 x i32> %__mask, i32 %QQQ + ret i32 %1 +} + +; CHECK: f_f___un_3C_unf_3E_un_3C_unf_3E_ +; CHECK: ret |