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

Nate Begeman natebegeman at mac.com
Sun Nov 6 01:01:06 PST 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.92 -> 1.93
---
Log message:

Add the necessary support to the ISel to allow targets to codegen the new
alignment information appropriately.  Includes code for PowerPC to support
fixed-size allocas with alignment larger than the stack.  Support for
arbitrarily aligned dynamic allocas coming soon.


---
Diffs of the changes:  (+5 -2)

 SelectionDAGISel.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.92 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.93
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.92	Sun Oct 30 13:42:35 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp	Sun Nov  6 03:00:38 2005
@@ -147,7 +147,9 @@
       if (ConstantUInt *CUI = dyn_cast<ConstantUInt>(AI->getArraySize())) {
         const Type *Ty = AI->getAllocatedType();
         uint64_t TySize = TLI.getTargetData().getTypeSize(Ty);
-        unsigned Align = TLI.getTargetData().getTypeAlignment(Ty);
+        unsigned Align = 
+          std::max((unsigned)TLI.getTargetData().getTypeAlignment(Ty),
+                   AI->getAlignment());
 
         // If the alignment of the value is smaller than the size of the value,
         // and if the size of the value is particularly small (<= 8 bytes),
@@ -636,7 +638,8 @@
 
   const Type *Ty = I.getAllocatedType();
   uint64_t TySize = TLI.getTargetData().getTypeSize(Ty);
-  unsigned Align = TLI.getTargetData().getTypeAlignment(Ty);
+  unsigned Align = std::max((unsigned)TLI.getTargetData().getTypeAlignment(Ty),
+                            I.getAlignment());
 
   SDOperand AllocSize = getValue(I.getArraySize());
   MVT::ValueType IntPtr = TLI.getPointerTy();






More information about the llvm-commits mailing list