Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp
Show First 20 Lines • Show All 1,433 Lines • ▼ Show 20 Lines | static const unsigned VectExpOps[] = { | ||||
ISD::BR_CC, ISD::SELECT_CC, ISD::ConstantPool, | ISD::BR_CC, ISD::SELECT_CC, ISD::ConstantPool, | ||||
// Vector: | // Vector: | ||||
ISD::BUILD_VECTOR, ISD::SCALAR_TO_VECTOR, | ISD::BUILD_VECTOR, ISD::SCALAR_TO_VECTOR, | ||||
ISD::EXTRACT_VECTOR_ELT, ISD::INSERT_VECTOR_ELT, | ISD::EXTRACT_VECTOR_ELT, ISD::INSERT_VECTOR_ELT, | ||||
ISD::EXTRACT_SUBVECTOR, ISD::INSERT_SUBVECTOR, | ISD::EXTRACT_SUBVECTOR, ISD::INSERT_SUBVECTOR, | ||||
ISD::CONCAT_VECTORS, ISD::VECTOR_SHUFFLE | ISD::CONCAT_VECTORS, ISD::VECTOR_SHUFFLE | ||||
}; | }; | ||||
for (MVT VT : MVT::vector_valuetypes()) { | for (MVT VT : MVT::fixedlen_vector_valuetypes()) { | ||||
for (unsigned VectExpOp : VectExpOps) | for (unsigned VectExpOp : VectExpOps) | ||||
setOperationAction(VectExpOp, VT, Expand); | setOperationAction(VectExpOp, VT, Expand); | ||||
// Expand all extending loads and truncating stores: | // Expand all extending loads and truncating stores: | ||||
for (MVT TargetVT : MVT::vector_valuetypes()) { | for (MVT TargetVT : MVT::fixedlen_vector_valuetypes()) { | ||||
if (TargetVT == VT) | if (TargetVT == VT) | ||||
continue; | continue; | ||||
setLoadExtAction(ISD::EXTLOAD, TargetVT, VT, Expand); | setLoadExtAction(ISD::EXTLOAD, TargetVT, VT, Expand); | ||||
setLoadExtAction(ISD::ZEXTLOAD, TargetVT, VT, Expand); | setLoadExtAction(ISD::ZEXTLOAD, TargetVT, VT, Expand); | ||||
setLoadExtAction(ISD::SEXTLOAD, TargetVT, VT, Expand); | setLoadExtAction(ISD::SEXTLOAD, TargetVT, VT, Expand); | ||||
setTruncStoreAction(VT, TargetVT, Expand); | setTruncStoreAction(VT, TargetVT, Expand); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 403 Lines • ▼ Show 20 Lines | |||||
bool HexagonTargetLowering::isShuffleMaskLegal(ArrayRef<int> Mask, | bool HexagonTargetLowering::isShuffleMaskLegal(ArrayRef<int> Mask, | ||||
EVT VT) const { | EVT VT) const { | ||||
return true; | return true; | ||||
} | } | ||||
TargetLoweringBase::LegalizeTypeAction | TargetLoweringBase::LegalizeTypeAction | ||||
HexagonTargetLowering::getPreferredVectorAction(MVT VT) const { | HexagonTargetLowering::getPreferredVectorAction(MVT VT) const { | ||||
if (VT.getVectorNumElements() == 1) | if (VT.getVectorNumElements() == 1 || VT.isScalableVector()) | ||||
return TargetLoweringBase::TypeScalarizeVector; | return TargetLoweringBase::TypeScalarizeVector; | ||||
// Always widen vectors of i1. | // Always widen vectors of i1. | ||||
MVT ElemTy = VT.getVectorElementType(); | MVT ElemTy = VT.getVectorElementType(); | ||||
if (ElemTy == MVT::i1) | if (ElemTy == MVT::i1) | ||||
return TargetLoweringBase::TypeWidenVector; | return TargetLoweringBase::TypeWidenVector; | ||||
if (Subtarget.useHVXOps()) { | if (Subtarget.useHVXOps()) { | ||||
▲ Show 20 Lines • Show All 1,422 Lines • Show Last 20 Lines |