Revert Christopher Lamb's load/store alignment changes.
[oota-llvm.git] / include / llvm / CodeGen / SelectionDAGNodes.h
index 5d1a0e3efb4f0f094095b11623a66f4936747c0e..77d607a2cb6d0d02a8fa5d64b42551ae4aaf5e02 100644 (file)
@@ -19,6 +19,7 @@
 #ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
 #define LLVM_CODEGEN_SELECTIONDAGNODES_H
 
+#include "llvm/GlobalVariable.h"
 #include "llvm/Value.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/GraphTraits.h"
@@ -95,7 +96,8 @@ namespace ISD {
     // Various leaf nodes.
     STRING, BasicBlock, VALUETYPE, CONDCODE, Register,
     Constant, ConstantFP,
-    GlobalAddress, FrameIndex, JumpTable, ConstantPool, ExternalSymbol,
+    GlobalAddress, GlobalTLSAddress, FrameIndex,
+    JumpTable, ConstantPool, ExternalSymbol,
 
     // The address of the GOT
     GLOBAL_OFFSET_TABLE,
@@ -124,6 +126,7 @@ namespace ISD {
     // anything else with this node, and this is valid in the target-specific
     // dag, turning into a GlobalAddress operand.
     TargetGlobalAddress,
+    TargetGlobalTLSAddress,
     TargetFrameIndex,
     TargetJumpTable,
     TargetConstantPool,
@@ -430,10 +433,11 @@ namespace ISD {
     TRUNCSTORE,
 
     // DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned
-    // to a specified boundary.  The first operand is the token chain, the
-    // second is the number of bytes to allocate, and the third is the alignment
-    // boundary.  The size is guaranteed to be a multiple of the stack 
-    // alignment, and the alignment is guaranteed to be bigger than the stack 
+    // to a specified boundary.  This node always has two return values: a new
+    // stack pointer value and a chain. The first operand is the token chain,
+    // the second is the number of bytes to allocate, and the third is the
+    // alignment boundary.  The size is guaranteed to be a multiple of the stack
+    // alignment, and the alignment is guaranteed to be bigger than the stack
     // alignment (if required) or 0 to get standard stack alignment.
     DYNAMIC_STACKALLOC,
 
@@ -911,7 +915,7 @@ public:
 
   /// getOperationName - Return the opcode of this operation for printing.
   ///
-  const char* getOperationName(const SelectionDAG *G = 0) const;
+  std::string getOperationName(const SelectionDAG *G = 0) const;
   static const char* getIndexedModeName(ISD::MemIndexedMode AM);
   void dump() const;
   void dump(const SelectionDAG *G) const;
@@ -1163,7 +1167,12 @@ protected:
   friend class SelectionDAG;
   GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
                       int o = 0)
-    : SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress,
+    : SDNode(dyn_cast<GlobalVariable>(GA) &&
+             dyn_cast<GlobalVariable>(GA)->isThreadLocal() ?
+             // Thread Local
+             (isTarget ? ISD::TargetGlobalTLSAddress : ISD::GlobalTLSAddress) :
+             // Non Thread Local
+             (isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress),
              getSDVTList(VT)), Offset(o) {
     TheGlobal = const_cast<GlobalValue*>(GA);
   }
@@ -1175,11 +1184,12 @@ public:
   static bool classof(const GlobalAddressSDNode *) { return true; }
   static bool classof(const SDNode *N) {
     return N->getOpcode() == ISD::GlobalAddress ||
-           N->getOpcode() == ISD::TargetGlobalAddress;
+           N->getOpcode() == ISD::TargetGlobalAddress ||
+           N->getOpcode() == ISD::GlobalTLSAddress ||
+           N->getOpcode() == ISD::TargetGlobalTLSAddress;
   }
 };
 
-
 class FrameIndexSDNode : public SDNode {
   int FI;
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.