mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-29 13:24:25 +00:00
Add VectorTargetTransform::getNumberOfParts.
As discussed on IRC, add VectorTargetTransform::getNumberOfParts to provide a stable interface to the vector legalization splitting factor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166751 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -68,6 +68,8 @@ public:
|
|||||||
virtual unsigned getMemoryOpCost(unsigned Opcode, Type *Src,
|
virtual unsigned getMemoryOpCost(unsigned Opcode, Type *Src,
|
||||||
unsigned Alignment,
|
unsigned Alignment,
|
||||||
unsigned AddressSpace) const;
|
unsigned AddressSpace) const;
|
||||||
|
|
||||||
|
virtual unsigned getNumberOfParts(Type *Tp) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end llvm namespace
|
} // end llvm namespace
|
||||||
|
@ -156,6 +156,11 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the number of pieces into which the provided type must be
|
||||||
|
/// split during legalization. Zero is returned when the answer is unknown.
|
||||||
|
virtual unsigned getNumberOfParts(Type *Tp) const {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
@ -196,3 +196,11 @@ VectorTargetTransformImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
|
|||||||
// Assume that all loads of legal types cost 1.
|
// Assume that all loads of legal types cost 1.
|
||||||
return LT.first;
|
return LT.first;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned
|
||||||
|
VectorTargetTransformImpl::getNumberOfParts(Type *Tp) const {
|
||||||
|
std::pair<unsigned, EVT> LT =
|
||||||
|
getTypeLegalizationCost(Tp->getContext(), TLI->getValueType(Tp));
|
||||||
|
return LT.first;
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user