summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-14 07:45:46 +0000
committerChris Lattner <sabre@nondot.org>2005-05-14 07:45:46 +0000
commit3e01136f9fc2e1db9207d278002e76e6175783e9 (patch)
treeed8abbb9beb0a83863262c9beaea4b70be49edfe /lib
parent385328ce416e2b98d7113a75d9413a56a2b10318 (diff)
downloadllvm-3e01136f9fc2e1db9207d278002e76e6175783e9.tar.gz
llvm-3e01136f9fc2e1db9207d278002e76e6175783e9.tar.bz2
llvm-3e01136f9fc2e1db9207d278002e76e6175783e9.tar.xz
remove special case hacks for readport/readio from the binary operator
codepath git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp21
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
2 files changed, 15 insertions, 13 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 2f259b1eb4..e611557716 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -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:
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index bfaca1de14..c3889dd7ff 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -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);
}