mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-16 04:52:16 +00:00
Change TargetLowering::TransformToType to contain MVTs, instead of
EVTs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170534 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1317d26461
commit
ff01277841
@ -1951,7 +1951,7 @@ private:
|
|||||||
/// contains one step of the expand (e.g. i64 -> i32), even if there are
|
/// contains one step of the expand (e.g. i64 -> i32), even if there are
|
||||||
/// multiple steps required (e.g. i64 -> i16). For types natively supported
|
/// multiple steps required (e.g. i64 -> i16). For types natively supported
|
||||||
/// by the system, this holds the same type (e.g. i32 -> i32).
|
/// by the system, this holds the same type (e.g. i32 -> i32).
|
||||||
EVT TransformToType[MVT::LAST_VALUETYPE];
|
MVT TransformToType[MVT::LAST_VALUETYPE];
|
||||||
|
|
||||||
/// OpActions - For each operation and each value type, keep a LegalizeAction
|
/// OpActions - For each operation and each value type, keep a LegalizeAction
|
||||||
/// that indicates how instruction selection should deal with the operation.
|
/// that indicates how instruction selection should deal with the operation.
|
||||||
@ -1992,19 +1992,19 @@ public:
|
|||||||
getTypeConversion(LLVMContext &Context, EVT VT) const {
|
getTypeConversion(LLVMContext &Context, EVT VT) const {
|
||||||
// If this is a simple type, use the ComputeRegisterProp mechanism.
|
// If this is a simple type, use the ComputeRegisterProp mechanism.
|
||||||
if (VT.isSimple()) {
|
if (VT.isSimple()) {
|
||||||
assert((unsigned)VT.getSimpleVT().SimpleTy <
|
MVT SVT = VT.getSimpleVT();
|
||||||
array_lengthof(TransformToType));
|
assert((unsigned)SVT.SimpleTy < array_lengthof(TransformToType));
|
||||||
EVT NVT = TransformToType[VT.getSimpleVT().SimpleTy];
|
MVT NVT = TransformToType[SVT.SimpleTy];
|
||||||
LegalizeTypeAction LA = ValueTypeActions.getTypeAction(VT.getSimpleVT());
|
LegalizeTypeAction LA = ValueTypeActions.getTypeAction(SVT);
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
(!(NVT.isSimple() && LA != TypeLegal) ||
|
(LA == TypeLegal ||
|
||||||
ValueTypeActions.getTypeAction(NVT.getSimpleVT()) != TypePromoteInteger)
|
ValueTypeActions.getTypeAction(NVT) != TypePromoteInteger)
|
||||||
&& "Promote may not follow Expand or Promote");
|
&& "Promote may not follow Expand or Promote");
|
||||||
|
|
||||||
if (LA == TypeSplitVector)
|
if (LA == TypeSplitVector)
|
||||||
NVT = EVT::getVectorVT(Context, VT.getVectorElementType(),
|
NVT = MVT::getVectorVT(SVT.getVectorElementType(),
|
||||||
VT.getVectorNumElements() / 2);
|
SVT.getVectorNumElements() / 2);
|
||||||
return LegalizeKind(LA, NVT);
|
return LegalizeKind(LA, NVT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -823,14 +823,14 @@ void TargetLowering::computeRegisterProperties() {
|
|||||||
|
|
||||||
// Determine if there is a legal wider type. If so, we should promote to
|
// Determine if there is a legal wider type. If so, we should promote to
|
||||||
// that wider vector type.
|
// that wider vector type.
|
||||||
EVT EltVT = VT.getVectorElementType();
|
MVT EltVT = VT.getVectorElementType();
|
||||||
unsigned NElts = VT.getVectorNumElements();
|
unsigned NElts = VT.getVectorNumElements();
|
||||||
if (NElts != 1 && !shouldSplitVectorElementType(EltVT)) {
|
if (NElts != 1 && !shouldSplitVectorElementType(EltVT)) {
|
||||||
bool IsLegalWiderType = false;
|
bool IsLegalWiderType = false;
|
||||||
// First try to promote the elements of integer vectors. If no legal
|
// First try to promote the elements of integer vectors. If no legal
|
||||||
// promotion was found, fallback to the widen-vector method.
|
// promotion was found, fallback to the widen-vector method.
|
||||||
for (unsigned nVT = i+1; nVT <= MVT::LAST_VECTOR_VALUETYPE; ++nVT) {
|
for (unsigned nVT = i+1; nVT <= MVT::LAST_VECTOR_VALUETYPE; ++nVT) {
|
||||||
EVT 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.getVectorElementType().getSizeInBits() > EltVT.getSizeInBits()
|
if (SVT.getVectorElementType().getSizeInBits() > EltVT.getSizeInBits()
|
||||||
@ -849,7 +849,7 @@ void TargetLowering::computeRegisterProperties() {
|
|||||||
|
|
||||||
// Try to widen the vector.
|
// Try to widen the vector.
|
||||||
for (unsigned nVT = i+1; nVT <= MVT::LAST_VECTOR_VALUETYPE; ++nVT) {
|
for (unsigned nVT = i+1; nVT <= MVT::LAST_VECTOR_VALUETYPE; ++nVT) {
|
||||||
EVT SVT = (MVT::SimpleValueType)nVT;
|
MVT SVT = (MVT::SimpleValueType)nVT;
|
||||||
if (SVT.getVectorElementType() == EltVT &&
|
if (SVT.getVectorElementType() == EltVT &&
|
||||||
SVT.getVectorNumElements() > NElts &&
|
SVT.getVectorNumElements() > NElts &&
|
||||||
isTypeLegal(SVT)) {
|
isTypeLegal(SVT)) {
|
||||||
@ -872,7 +872,7 @@ void TargetLowering::computeRegisterProperties() {
|
|||||||
RegisterVT, this);
|
RegisterVT, this);
|
||||||
RegisterTypeForVT[i] = RegisterVT;
|
RegisterTypeForVT[i] = RegisterVT;
|
||||||
|
|
||||||
EVT NVT = VT.getPow2VectorType();
|
MVT NVT = VT.getPow2VectorType();
|
||||||
if (NVT == VT) {
|
if (NVT == VT) {
|
||||||
// Type is already a power of 2. The default action is to split.
|
// Type is already a power of 2. The default action is to split.
|
||||||
TransformToType[i] = MVT::Other;
|
TransformToType[i] = MVT::Other;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user