[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h

Christopher Lamb christopher.lamb at gmail.com
Sat Apr 21 01:16:55 PDT 2007



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAG.h updated: 1.147 -> 1.148
SelectionDAGNodes.h updated: 1.185 -> 1.186
---
Log message:


add support for alignment attributes on load/store instructions


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

 SelectionDAG.h      |   11 +++++++----
 SelectionDAGNodes.h |    4 +++-
 2 files changed, 10 insertions(+), 5 deletions(-)


Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.147 llvm/include/llvm/CodeGen/SelectionDAG.h:1.148
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.147	Fri Apr 20 16:38:10 2007
+++ llvm/include/llvm/CodeGen/SelectionDAG.h	Sat Apr 21 03:16:25 2007
@@ -311,10 +311,12 @@
   /// determined by their operands, and they produce a value AND a token chain.
   ///
   SDOperand getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr,
-                    const Value *SV, int SVOffset, bool isVolatile=false);
+                    const Value *SV, int SVOffset, bool isVolatile=false,
+                    unsigned Alignment=0);
   SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT,
                        SDOperand Chain, SDOperand Ptr, const Value *SV,
-                       int SVOffset, MVT::ValueType EVT, bool isVolatile=false);
+                       int SVOffset, MVT::ValueType EVT, bool isVolatile=false,
+                       unsigned Alignment=0);
   SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base,
                            SDOperand Offset, ISD::MemIndexedMode AM);
   SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain, 
@@ -323,10 +325,11 @@
   /// getStore - Helper function to build ISD::STORE nodes.
   ///
   SDOperand getStore(SDOperand Chain, SDOperand Val, SDOperand Ptr,
-                     const Value *SV, int SVOffset, bool isVolatile=false);
+                     const Value *SV, int SVOffset, bool isVolatile=false,
+                     unsigned Alignment=0);
   SDOperand getTruncStore(SDOperand Chain, SDOperand Val, SDOperand Ptr,
                           const Value *SV, int SVOffset, MVT::ValueType TVT,
-                          bool isVolatile=false);
+                          bool isVolatile=false, unsigned Alignment=0);
   SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base,
                            SDOperand Offset, ISD::MemIndexedMode AM);
 


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.185 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.186
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.185	Fri Apr 20 16:38:10 2007
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Sat Apr 21 03:16:25 2007
@@ -1448,7 +1448,7 @@
   friend class SelectionDAG;
   LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs,
              ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT,
-             const Value *SV, int O=0, unsigned Align=1, bool Vol=false)
+             const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
     : SDNode(ISD::LOAD, VTs),
       AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O),
       Alignment(Align), IsVolatile(Vol) {
@@ -1456,6 +1456,7 @@
     Ops[1] = ChainPtrOff[1]; // Ptr
     Ops[2] = ChainPtrOff[2]; // Off
     InitOperands(Ops, 3);
+    assert(Align != 0 && "Loads should have non-zero aligment");
     assert((getOffset().getOpcode() == ISD::UNDEF ||
             AddrMode != ISD::UNINDEXED) &&
            "Only indexed load has a non-undef offset operand");
@@ -1518,6 +1519,7 @@
     Ops[2] = ChainValuePtrOff[2]; // Ptr
     Ops[3] = ChainValuePtrOff[3]; // Off
     InitOperands(Ops, 4);
+    assert(Align != 0 && "Stores should have non-zero aligment");
     assert((getOffset().getOpcode() == ISD::UNDEF || 
             AddrMode != ISD::UNINDEXED) &&
            "Only indexed store has a non-undef offset operand");






More information about the llvm-commits mailing list