[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp SelectionDAG.cpp

Evan Cheng evan.cheng at apple.com
Tue Jan 31 14:23:27 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

ScheduleDAG.cpp updated: 1.61 -> 1.62
SelectionDAG.cpp updated: 1.250 -> 1.251
---
Log message:

Allow the specification of explicit alignments for constant pool entries.


---
Diffs of the changes:  (+16 -9)

 ScheduleDAG.cpp  |    3 ++-
 SelectionDAG.cpp |   22 ++++++++++++++--------
 2 files changed, 16 insertions(+), 9 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.61 llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.62
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.61	Mon Jan 30 20:03:41 2006
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp	Tue Jan 31 16:23:14 2006
@@ -194,7 +194,8 @@
         MI->addFrameIndexOperand(FI->getIndex());
       } else if (ConstantPoolSDNode *CP = 
                     dyn_cast<ConstantPoolSDNode>(Node->getOperand(i))) {
-        unsigned Idx = ConstPool->getConstantPoolIndex(CP->get());
+        unsigned Idx = ConstPool->getConstantPoolIndex(CP->get(),
+                                                       CP->getAlignment());
         MI->addConstantPoolIndexOperand(Idx);
       } else if (ExternalSymbolSDNode *ES = 
                  dyn_cast<ExternalSymbolSDNode>(Node->getOperand(i))) {


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.250 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.251
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.250	Sun Jan 29 01:58:15 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp	Tue Jan 31 16:23:14 2006
@@ -310,10 +310,14 @@
     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 @@
   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);
 }






More information about the llvm-commits mailing list