[llvm] r323207 - Use EVT::changeVectorElementTypeToInteger() to convert index type to integer
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 23 07:30:07 PST 2018
Author: rksimon
Date: Tue Jan 23 07:30:07 2018
New Revision: 323207
URL: http://llvm.org/viewvc/llvm-project?rev=323207&view=rev
Log:
Use EVT::changeVectorElementTypeToInteger() to convert index type to integer
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=323207&r1=323206&r2=323207&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jan 23 07:30:07 2018
@@ -7920,16 +7920,16 @@ LowerBUILD_VECTORAsVariablePermute(SDVal
if (!PermIdx || PermIdx->getZExtValue() != Idx)
return SDValue();
}
- MVT IndicesVT = VT;
- if (VT.isFloatingPoint())
- IndicesVT = MVT::getVectorVT(MVT::getIntegerVT(VT.getScalarSizeInBits()),
- VT.getVectorNumElements());
+
+ MVT IndicesVT = EVT(VT).changeVectorElementTypeToInteger().getSimpleVT();
IndicesVec = DAG.getZExtOrTrunc(IndicesVec, SDLoc(IndicesVec), IndicesVT);
+
if (SrcVec.getValueSizeInBits() < IndicesVT.getSizeInBits()) {
SrcVec =
DAG.getNode(ISD::INSERT_SUBVECTOR, SDLoc(SrcVec), VT, DAG.getUNDEF(VT),
SrcVec, DAG.getIntPtrConstant(0, SDLoc(SrcVec)));
}
+
if (VT == MVT::v16i8)
return DAG.getNode(X86ISD::PSHUFB, SDLoc(V), VT, SrcVec, IndicesVec);
return DAG.getNode(X86ISD::VPERMV, SDLoc(V), VT, IndicesVec, SrcVec);
More information about the llvm-commits
mailing list