1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

remove special case hacks for readport/readio from the binary operator

codepath

llvm-svn: 22019
This commit is contained in:
Chris Lattner 2005-05-14 07:45:46 +00:00
parent d1d8fbee2d
commit d9e36f94bb
2 changed files with 15 additions and 13 deletions

View File

@ -977,9 +977,13 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
Tmp1 = LegalizeOp(Node->getOperand(0));
Tmp2 = LegalizeOp(Node->getOperand(1));
if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1))
Result = DAG.getNode(ISD::READPORT, Node->getValueType(0), Tmp1, Tmp2);
else
if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1)) {
std::vector<MVT::ValueType> VTs(Node->value_begin(), Node->value_end());
std::vector<SDOperand> Ops;
Ops.push_back(Tmp1);
Ops.push_back(Tmp2);
Result = DAG.getNode(ISD::READPORT, VTs, Ops);
} else
Result = SDOperand(Node, 0);
// Since these produce two values, make sure to remember that we legalized
// both of them.
@ -1003,10 +1007,13 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
case TargetLowering::Custom:
default: assert(0 && "This action not implemented for this operation!");
case TargetLowering::Legal:
if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1))
Result = DAG.getNode(Node->getOpcode(), Node->getValueType(0),
Tmp1, Tmp2);
else
if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1)) {
std::vector<MVT::ValueType> VTs(Node->value_begin(), Node->value_end());
std::vector<SDOperand> Ops;
Ops.push_back(Tmp1);
Ops.push_back(Tmp2);
Result = DAG.getNode(ISD::READPORT, VTs, Ops);
} else
Result = SDOperand(Node, 0);
break;
case TargetLowering::Expand:

View File

@ -1215,12 +1215,7 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
N = new SDNode(Opcode, N1, N2);
}
if (Opcode != ISD::READPORT && Opcode != ISD::READIO)
N->setValueTypes(VT);
else
N->setValueTypes(VT, MVT::Other);
N->setValueTypes(VT);
AllNodes.push_back(N);
return SDOperand(N, 0);
}