aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-01-31 22:23:14 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-01-31 22:23:14 +0000
commitb8973bd8f50d7321635e1e07b81a880a0828d185 (patch)
tree452842927ad6a1c0969372cef9b984007ac68328 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent259e97cc725011a3c138563d421a4654b082a64c (diff)
Allow the specification of explicit alignments for constant pool entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index aa9ea638f8..6f1a263048 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -310,10 +310,14 @@ void SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
Erased = TargetFrameIndices.erase(cast<FrameIndexSDNode>(N)->getIndex());
break;
case ISD::ConstantPool:
- Erased = ConstantPoolIndices.erase(cast<ConstantPoolSDNode>(N)->get());
+ Erased = ConstantPoolIndices.
+ erase(std::make_pair(cast<ConstantPoolSDNode>(N)->get(),
+ cast<ConstantPoolSDNode>(N)->getAlignment()));
break;
case ISD::TargetConstantPool:
- Erased =TargetConstantPoolIndices.erase(cast<ConstantPoolSDNode>(N)->get());
+ Erased = TargetConstantPoolIndices.
+ erase(std::make_pair(cast<ConstantPoolSDNode>(N)->get(),
+ cast<ConstantPoolSDNode>(N)->getAlignment()));
break;
case ISD::BasicBlock:
Erased = BBNodes.erase(cast<BasicBlockSDNode>(N)->getBasicBlock());
@@ -655,18 +659,20 @@ SDOperand SelectionDAG::getTargetFrameIndex(int FI, MVT::ValueType VT) {
return SDOperand(N, 0);
}
-SDOperand SelectionDAG::getConstantPool(Constant *C, MVT::ValueType VT) {
- SDNode *&N = ConstantPoolIndices[C];
+SDOperand SelectionDAG::getConstantPool(Constant *C, MVT::ValueType VT,
+ unsigned Alignment) {
+ SDNode *&N = ConstantPoolIndices[std::make_pair(C, Alignment)];
if (N) return SDOperand(N, 0);
- N = new ConstantPoolSDNode(C, VT, false);
+ N = new ConstantPoolSDNode(C, VT, Alignment, false);
AllNodes.push_back(N);
return SDOperand(N, 0);
}
-SDOperand SelectionDAG::getTargetConstantPool(Constant *C, MVT::ValueType VT) {
- SDNode *&N = TargetConstantPoolIndices[C];
+SDOperand SelectionDAG::getTargetConstantPool(Constant *C, MVT::ValueType VT,
+ unsigned Alignment) {
+ SDNode *&N = TargetConstantPoolIndices[std::make_pair(C, Alignment)];
if (N) return SDOperand(N, 0);
- N = new ConstantPoolSDNode(C, VT, true);
+ N = new ConstantPoolSDNode(C, VT, Alignment, true);
AllNodes.push_back(N);
return SDOperand(N, 0);
}