summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-25 05:03:06 +0000
committerChris Lattner <sabre@nondot.org>2005-08-25 05:03:06 +0000
commit407c6415b4102832789382b72486dbb5e4b16aa9 (patch)
tree0a4566a8eeab0643c1bcd108c22991e434214512 /llvm/lib/CodeGen
parent79b8dad7ea2f8291715eddff0a975ff80dd7aa88 (diff)
downloadbcm5719-llvm-407c6415b4102832789382b72486dbb5e4b16aa9.tar.gz
bcm5719-llvm-407c6415b4102832789382b72486dbb5e4b16aa9.zip
ADd support for TargetConstantPool nodes
llvm-svn: 23041
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 68ef11e8bf9..72352f10fde 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -267,6 +267,9 @@ void SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
case ISD::ConstantPool:
ConstantPoolIndices.erase(cast<ConstantPoolSDNode>(N)->getIndex());
break;
+ case ISD::TargetConstantPool:
+ TargetConstantPoolIndices.erase(cast<ConstantPoolSDNode>(N)->getIndex());
+ break;
case ISD::BasicBlock:
BBNodes.erase(cast<BasicBlockSDNode>(N)->getBasicBlock());
break;
@@ -452,7 +455,16 @@ SDOperand SelectionDAG::getTargetFrameIndex(int FI, MVT::ValueType VT) {
SDOperand SelectionDAG::getConstantPool(unsigned CPIdx, MVT::ValueType VT) {
SDNode *N = ConstantPoolIndices[CPIdx];
if (N) return SDOperand(N, 0);
- N = new ConstantPoolSDNode(CPIdx, VT);
+ N = new ConstantPoolSDNode(CPIdx, VT, false);
+ AllNodes.push_back(N);
+ return SDOperand(N, 0);
+}
+
+SDOperand SelectionDAG::getTargetConstantPool(unsigned CPIdx,
+ MVT::ValueType VT) {
+ SDNode *N = TargetConstantPoolIndices[CPIdx];
+ if (N) return SDOperand(N, 0);
+ N = new ConstantPoolSDNode(CPIdx, VT, true);
AllNodes.push_back(N);
return SDOperand(N, 0);
}
@@ -2087,6 +2099,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
case ISD::Register: return "Register";
case ISD::ExternalSymbol: return "ExternalSymbol";
case ISD::ConstantPool: return "ConstantPoolIndex";
+ case ISD::TargetConstantPool: return "TargetConstantPoolIndex";
case ISD::CopyToReg: return "CopyToReg";
case ISD::CopyFromReg: return "CopyFromReg";
case ISD::ImplicitDef: return "ImplicitDef";
OpenPOWER on IntegriCloud