[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri May 13 16:14:34 PDT 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAGISel.cpp updated: 1.56 -> 1.57
---
Log message:
Align doubles on 8-byte boundaries if possible.
---
Diffs of the changes: (+9 -0)
SelectionDAGISel.cpp | 9 +++++++++
1 files changed, 9 insertions(+)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.56 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.57
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.56 Fri May 13 13:50:42 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri May 13 18:14:17 2005
@@ -140,6 +140,15 @@
const Type *Ty = AI->getAllocatedType();
uint64_t TySize = TLI.getTargetData().getTypeSize(Ty);
unsigned Align = TLI.getTargetData().getTypeAlignment(Ty);
+
+ // 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),
+ // round up to the size of the value for potentially better performance.
+ //
+ // FIXME: This could be made better with a preferred alignment hook in
+ // TargetData. It serves primarily to 8-byte align doubles for X86.
+ if (Align < TySize && TySize <= 8) Align = TySize;
+
TySize *= CUI->getValue(); // Get total allocated size.
StaticAllocaMap[AI] =
MF.getFrameInfo()->CreateStackObject((unsigned)TySize, Align);
More information about the llvm-commits
mailing list