Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp
Show First 20 Lines • Show All 1,260 Lines • ▼ Show 20 Lines | for (unsigned i = MVT::FIRST_VECTOR_VALUETYPE; | ||||
MVT EltVT = VT.getVectorElementType(); | MVT EltVT = VT.getVectorElementType(); | ||||
unsigned NElts = VT.getVectorNumElements(); | unsigned NElts = VT.getVectorNumElements(); | ||||
bool IsLegalWiderType = false; | bool IsLegalWiderType = false; | ||||
LegalizeTypeAction PreferredAction = getPreferredVectorAction(VT); | LegalizeTypeAction PreferredAction = getPreferredVectorAction(VT); | ||||
switch (PreferredAction) { | switch (PreferredAction) { | ||||
case TypePromoteInteger: | case TypePromoteInteger: | ||||
// Try to promote the elements of integer vectors. If no legal | // Try to promote the elements of integer vectors. If no legal | ||||
// promotion was found, fall through to the widen-vector method. | // promotion was found, fall through to the widen-vector method. | ||||
for (unsigned nVT = i + 1; nVT <= MVT::LAST_INTEGER_VECTOR_VALUETYPE; ++nVT) { | for (unsigned nVT = i + 1; | ||||
nVT <= MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE; ++nVT) { | |||||
MVT SVT = (MVT::SimpleValueType) nVT; | MVT SVT = (MVT::SimpleValueType) nVT; | ||||
// Promote vectors of integers to vectors with the same number | // Promote vectors of integers to vectors with the same number | ||||
// of elements, with a wider element type. | // of elements, with a wider element type. | ||||
if (SVT.getScalarSizeInBits() > EltVT.getSizeInBits() && | if (SVT.getScalarSizeInBits() > EltVT.getSizeInBits() && | ||||
SVT.getVectorNumElements() == NElts && isTypeLegal(SVT)) { | SVT.getVectorNumElements() == NElts && isTypeLegal(SVT)) { | ||||
TransformToType[i] = SVT; | TransformToType[i] = SVT; | ||||
RegisterTypeForVT[i] = SVT; | RegisterTypeForVT[i] = SVT; | ||||
NumRegistersForVT[i] = 1; | NumRegistersForVT[i] = 1; | ||||
▲ Show 20 Lines • Show All 701 Lines • Show Last 20 Lines |