mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-12 18:33:22 +00:00
Change TargetLowering::getTypeToPromoteTo to take and return MVTs,
instead of EVTs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169844 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
204301f045
commit
bb2543bb0e
@ -543,22 +543,22 @@ public:
|
|||||||
|
|
||||||
/// getTypeToPromoteTo - If the action for this operation is to promote, this
|
/// getTypeToPromoteTo - If the action for this operation is to promote, this
|
||||||
/// method returns the ValueType to promote to.
|
/// method returns the ValueType to promote to.
|
||||||
EVT getTypeToPromoteTo(unsigned Op, EVT VT) const {
|
MVT getTypeToPromoteTo(unsigned Op, MVT VT) const {
|
||||||
assert(getOperationAction(Op, VT) == Promote &&
|
assert(getOperationAction(Op, VT) == Promote &&
|
||||||
"This operation isn't promoted!");
|
"This operation isn't promoted!");
|
||||||
|
|
||||||
// See if this has an explicit type specified.
|
// See if this has an explicit type specified.
|
||||||
std::map<std::pair<unsigned, MVT::SimpleValueType>,
|
std::map<std::pair<unsigned, MVT::SimpleValueType>,
|
||||||
MVT::SimpleValueType>::const_iterator PTTI =
|
MVT::SimpleValueType>::const_iterator PTTI =
|
||||||
PromoteToType.find(std::make_pair(Op, VT.getSimpleVT().SimpleTy));
|
PromoteToType.find(std::make_pair(Op, VT.SimpleTy));
|
||||||
if (PTTI != PromoteToType.end()) return PTTI->second;
|
if (PTTI != PromoteToType.end()) return PTTI->second;
|
||||||
|
|
||||||
assert((VT.isInteger() || VT.isFloatingPoint()) &&
|
assert((VT.isInteger() || VT.isFloatingPoint()) &&
|
||||||
"Cannot autopromote this type, add it with AddPromotedToType.");
|
"Cannot autopromote this type, add it with AddPromotedToType.");
|
||||||
|
|
||||||
EVT NVT = VT;
|
MVT NVT = VT;
|
||||||
do {
|
do {
|
||||||
NVT = (MVT::SimpleValueType)(NVT.getSimpleVT().SimpleTy+1);
|
NVT = (MVT::SimpleValueType)(NVT.SimpleTy+1);
|
||||||
assert(NVT.isInteger() == VT.isInteger() && NVT != MVT::isVoid &&
|
assert(NVT.isInteger() == VT.isInteger() && NVT != MVT::isVoid &&
|
||||||
"Didn't find type to promote to!");
|
"Didn't find type to promote to!");
|
||||||
} while (!isTypeLegal(NVT) ||
|
} while (!isTypeLegal(NVT) ||
|
||||||
|
@ -710,7 +710,7 @@ void SelectionDAGLegalize::LegalizeStoreOps(SDNode *Node) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
SDValue Value = ST->getValue();
|
SDValue Value = ST->getValue();
|
||||||
EVT VT = Value.getValueType();
|
MVT VT = Value.getSimpleValueType();
|
||||||
switch (TLI.getOperationAction(ISD::STORE, VT)) {
|
switch (TLI.getOperationAction(ISD::STORE, VT)) {
|
||||||
default: llvm_unreachable("This action is not supported yet!");
|
default: llvm_unreachable("This action is not supported yet!");
|
||||||
case TargetLowering::Legal:
|
case TargetLowering::Legal:
|
||||||
@ -864,7 +864,7 @@ void SelectionDAGLegalize::LegalizeLoadOps(SDNode *Node) {
|
|||||||
|
|
||||||
ISD::LoadExtType ExtType = LD->getExtensionType();
|
ISD::LoadExtType ExtType = LD->getExtensionType();
|
||||||
if (ExtType == ISD::NON_EXTLOAD) {
|
if (ExtType == ISD::NON_EXTLOAD) {
|
||||||
EVT VT = Node->getValueType(0);
|
MVT VT = Node->getSimpleValueType(0);
|
||||||
SDValue RVal = SDValue(Node, 0);
|
SDValue RVal = SDValue(Node, 0);
|
||||||
SDValue RChain = SDValue(Node, 1);
|
SDValue RChain = SDValue(Node, 1);
|
||||||
|
|
||||||
@ -891,7 +891,7 @@ void SelectionDAGLegalize::LegalizeLoadOps(SDNode *Node) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetLowering::Promote: {
|
case TargetLowering::Promote: {
|
||||||
EVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VT);
|
MVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VT);
|
||||||
assert(NVT.getSizeInBits() == VT.getSizeInBits() &&
|
assert(NVT.getSizeInBits() == VT.getSizeInBits() &&
|
||||||
"Can only promote loads to same size type");
|
"Can only promote loads to same size type");
|
||||||
|
|
||||||
@ -3576,13 +3576,13 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node) {
|
|||||||
|
|
||||||
void SelectionDAGLegalize::PromoteNode(SDNode *Node) {
|
void SelectionDAGLegalize::PromoteNode(SDNode *Node) {
|
||||||
SmallVector<SDValue, 8> Results;
|
SmallVector<SDValue, 8> Results;
|
||||||
EVT OVT = Node->getValueType(0);
|
MVT OVT = Node->getSimpleValueType(0);
|
||||||
if (Node->getOpcode() == ISD::UINT_TO_FP ||
|
if (Node->getOpcode() == ISD::UINT_TO_FP ||
|
||||||
Node->getOpcode() == ISD::SINT_TO_FP ||
|
Node->getOpcode() == ISD::SINT_TO_FP ||
|
||||||
Node->getOpcode() == ISD::SETCC) {
|
Node->getOpcode() == ISD::SETCC) {
|
||||||
OVT = Node->getOperand(0).getValueType();
|
OVT = Node->getOperand(0).getSimpleValueType();
|
||||||
}
|
}
|
||||||
EVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), OVT);
|
MVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), OVT);
|
||||||
DebugLoc dl = Node->getDebugLoc();
|
DebugLoc dl = Node->getDebugLoc();
|
||||||
SDValue Tmp1, Tmp2, Tmp3;
|
SDValue Tmp1, Tmp2, Tmp3;
|
||||||
switch (Node->getOpcode()) {
|
switch (Node->getOpcode()) {
|
||||||
|
@ -293,10 +293,10 @@ SDValue VectorLegalizer::PromoteVectorOp(SDValue Op) {
|
|||||||
// Vector "promotion" is basically just bitcasting and doing the operation
|
// Vector "promotion" is basically just bitcasting and doing the operation
|
||||||
// in a different type. For example, x86 promotes ISD::AND on v2i32 to
|
// in a different type. For example, x86 promotes ISD::AND on v2i32 to
|
||||||
// v1i64.
|
// v1i64.
|
||||||
EVT VT = Op.getValueType();
|
MVT VT = Op.getSimpleValueType();
|
||||||
assert(Op.getNode()->getNumValues() == 1 &&
|
assert(Op.getNode()->getNumValues() == 1 &&
|
||||||
"Can't promote a vector with multiple results!");
|
"Can't promote a vector with multiple results!");
|
||||||
EVT NVT = TLI.getTypeToPromoteTo(Op.getOpcode(), VT);
|
MVT NVT = TLI.getTypeToPromoteTo(Op.getOpcode(), VT);
|
||||||
DebugLoc dl = Op.getDebugLoc();
|
DebugLoc dl = Op.getDebugLoc();
|
||||||
SmallVector<SDValue, 4> Operands(Op.getNumOperands());
|
SmallVector<SDValue, 4> Operands(Op.getNumOperands());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user