Can't fold the bit_convert is the store is a truncating store.
[oota-llvm.git] / lib / CodeGen / SelectionDAG / SelectionDAG.cpp
index 0de71203e4da0cb94bfb943e9c56c32b52a9c6ab..d1232f270da0bce04be0164ecc162d7a1892f20e 100644 (file)
 
 #include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/Constants.h"
-#include "llvm/GlobalValue.h"
+#include "llvm/GlobalVariable.h"
 #include "llvm/Intrinsics.h"
+#include "llvm/DerivedTypes.h"
 #include "llvm/Assembly/Writer.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineConstantPool.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Target/MRegisterInfo.h"
+#include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetLowering.h"
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetMachine.h"
@@ -285,78 +287,78 @@ static void AddNodeIDNode(FoldingSetNodeID &ID, SDNode *N) {
   AddNodeIDOperands(ID, N->op_begin(), N->getNumOperands());
 
   // Handle SDNode leafs with special info.
-  if (N->getNumOperands() == 0) {
-    switch (N->getOpcode()) {
-    default: break;  // Normal nodes don't need extra info.
-    case ISD::TargetConstant:
-    case ISD::Constant:
-      ID.AddInteger(cast<ConstantSDNode>(N)->getValue());
-      break;
-    case ISD::TargetConstantFP:
-    case ISD::ConstantFP:
-      ID.AddDouble(cast<ConstantFPSDNode>(N)->getValue());
-      break;
-    case ISD::TargetGlobalAddress:
-    case ISD::GlobalAddress: {
-      GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(N);
-      ID.AddPointer(GA->getGlobal());
-      ID.AddInteger(GA->getOffset());
-      break;
-    }
-    case ISD::BasicBlock:
-      ID.AddPointer(cast<BasicBlockSDNode>(N)->getBasicBlock());
-      break;
-    case ISD::Register:
-      ID.AddInteger(cast<RegisterSDNode>(N)->getReg());
-      break;
-    case ISD::SRCVALUE: {
-      SrcValueSDNode *SV = cast<SrcValueSDNode>(N);
-      ID.AddPointer(SV->getValue());
-      ID.AddInteger(SV->getOffset());
-      break;
-    }
-    case ISD::FrameIndex:
-    case ISD::TargetFrameIndex:
-      ID.AddInteger(cast<FrameIndexSDNode>(N)->getIndex());
-      break;
-    case ISD::JumpTable:
-    case ISD::TargetJumpTable:
-      ID.AddInteger(cast<JumpTableSDNode>(N)->getIndex());
-      break;
-    case ISD::ConstantPool:
-    case ISD::TargetConstantPool: {
-      ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(N);
-      ID.AddInteger(CP->getAlignment());
-      ID.AddInteger(CP->getOffset());
-      if (CP->isMachineConstantPoolEntry())
-        CP->getMachineCPVal()->AddSelectionDAGCSEId(ID);
-      else
-        ID.AddPointer(CP->getConstVal());
-      break;
-    }
-    case ISD::LOAD: {
-      LoadSDNode *LD = cast<LoadSDNode>(N);
-      ID.AddInteger(LD->getAddressingMode());
-      ID.AddInteger(LD->getExtensionType());
-      ID.AddInteger(LD->getLoadedVT());
-      ID.AddPointer(LD->getSrcValue());
-      ID.AddInteger(LD->getSrcValueOffset());
-      ID.AddInteger(LD->getAlignment());
-      ID.AddInteger(LD->isVolatile());
-      break;
-    }
-    case ISD::STORE: {
-      StoreSDNode *ST = cast<StoreSDNode>(N);
-      ID.AddInteger(ST->getAddressingMode());
-      ID.AddInteger(ST->isTruncatingStore());
-      ID.AddInteger(ST->getStoredVT());
-      ID.AddPointer(ST->getSrcValue());
-      ID.AddInteger(ST->getSrcValueOffset());
-      ID.AddInteger(ST->getAlignment());
-      ID.AddInteger(ST->isVolatile());
-      break;
-    }
-    }
+  switch (N->getOpcode()) {
+  default: break;  // Normal nodes don't need extra info.
+  case ISD::TargetConstant:
+  case ISD::Constant:
+    ID.AddInteger(cast<ConstantSDNode>(N)->getValue());
+    break;
+  case ISD::TargetConstantFP:
+  case ISD::ConstantFP:
+    ID.AddDouble(cast<ConstantFPSDNode>(N)->getValue());
+    break;
+  case ISD::TargetGlobalAddress:
+  case ISD::GlobalAddress:
+  case ISD::TargetGlobalTLSAddress:
+  case ISD::GlobalTLSAddress: {
+    GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(N);
+    ID.AddPointer(GA->getGlobal());
+    ID.AddInteger(GA->getOffset());
+    break;
+  }
+  case ISD::BasicBlock:
+    ID.AddPointer(cast<BasicBlockSDNode>(N)->getBasicBlock());
+    break;
+  case ISD::Register:
+    ID.AddInteger(cast<RegisterSDNode>(N)->getReg());
+    break;
+  case ISD::SRCVALUE: {
+    SrcValueSDNode *SV = cast<SrcValueSDNode>(N);
+    ID.AddPointer(SV->getValue());
+    ID.AddInteger(SV->getOffset());
+    break;
+  }
+  case ISD::FrameIndex:
+  case ISD::TargetFrameIndex:
+    ID.AddInteger(cast<FrameIndexSDNode>(N)->getIndex());
+    break;
+  case ISD::JumpTable:
+  case ISD::TargetJumpTable:
+    ID.AddInteger(cast<JumpTableSDNode>(N)->getIndex());
+    break;
+  case ISD::ConstantPool:
+  case ISD::TargetConstantPool: {
+    ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(N);
+    ID.AddInteger(CP->getAlignment());
+    ID.AddInteger(CP->getOffset());
+    if (CP->isMachineConstantPoolEntry())
+      CP->getMachineCPVal()->AddSelectionDAGCSEId(ID);
+    else
+      ID.AddPointer(CP->getConstVal());
+    break;
+  }
+  case ISD::LOAD: {
+    LoadSDNode *LD = cast<LoadSDNode>(N);
+    ID.AddInteger(LD->getAddressingMode());
+    ID.AddInteger(LD->getExtensionType());
+    ID.AddInteger(LD->getLoadedVT());
+    ID.AddPointer(LD->getSrcValue());
+    ID.AddInteger(LD->getSrcValueOffset());
+    ID.AddInteger(LD->getAlignment());
+    ID.AddInteger(LD->isVolatile());
+    break;
+  }
+  case ISD::STORE: {
+    StoreSDNode *ST = cast<StoreSDNode>(N);
+    ID.AddInteger(ST->getAddressingMode());
+    ID.AddInteger(ST->isTruncatingStore());
+    ID.AddInteger(ST->getStoredVT());
+    ID.AddPointer(ST->getSrcValue());
+    ID.AddInteger(ST->getSrcValueOffset());
+    ID.AddInteger(ST->getAlignment());
+    ID.AddInteger(ST->isVolatile());
+    break;
+  }
   }
 }
 
@@ -694,7 +696,12 @@ SDOperand SelectionDAG::getConstantFP(double Val, MVT::ValueType VT,
 SDOperand SelectionDAG::getGlobalAddress(const GlobalValue *GV,
                                          MVT::ValueType VT, int Offset,
                                          bool isTargetGA) {
-  unsigned Opc = isTargetGA ? ISD::TargetGlobalAddress : ISD::GlobalAddress;
+  const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
+  unsigned Opc;
+  if (GVar && GVar->isThreadLocal())
+    Opc = isTargetGA ? ISD::TargetGlobalTLSAddress : ISD::GlobalTLSAddress;
+  else
+    Opc = isTargetGA ? ISD::TargetGlobalAddress : ISD::GlobalAddress;
   FoldingSetNodeID ID;
   AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
   ID.AddPointer(GV);
@@ -1048,19 +1055,30 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
   switch (Opcode) {
   case ISD::TokenFactor:
     return Operand;         // Factor of one node?  No factor.
+  case ISD::FP_ROUND:
+  case ISD::FP_EXTEND:
+    assert(MVT::isFloatingPoint(VT) &&
+           MVT::isFloatingPoint(Operand.getValueType()) && "Invalid FP cast!");
+    break;
   case ISD::SIGN_EXTEND:
+    assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) &&
+           "Invalid SIGN_EXTEND!");
     if (Operand.getValueType() == VT) return Operand;   // noop extension
     assert(Operand.getValueType() < VT && "Invalid sext node, dst < src!");
     if (OpOpcode == ISD::SIGN_EXTEND || OpOpcode == ISD::ZERO_EXTEND)
       return getNode(OpOpcode, VT, Operand.Val->getOperand(0));
     break;
   case ISD::ZERO_EXTEND:
+    assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) &&
+           "Invalid ZERO_EXTEND!");
     if (Operand.getValueType() == VT) return Operand;   // noop extension
     assert(Operand.getValueType() < VT && "Invalid zext node, dst < src!");
     if (OpOpcode == ISD::ZERO_EXTEND)   // (zext (zext x)) -> (zext x)
       return getNode(ISD::ZERO_EXTEND, VT, Operand.Val->getOperand(0));
     break;
   case ISD::ANY_EXTEND:
+    assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) &&
+           "Invalid ANY_EXTEND!");
     if (Operand.getValueType() == VT) return Operand;   // noop extension
     assert(Operand.getValueType() < VT && "Invalid anyext node, dst < src!");
     if (OpOpcode == ISD::ZERO_EXTEND || OpOpcode == ISD::SIGN_EXTEND)
@@ -1068,6 +1086,8 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
       return getNode(OpOpcode, VT, Operand.Val->getOperand(0));
     break;
   case ISD::TRUNCATE:
+    assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) &&
+           "Invalid TRUNCATE!");
     if (Operand.getValueType() == VT) return Operand;   // noop truncate
     assert(Operand.getValueType() > VT && "Invalid truncate node, src < dst!");
     if (OpOpcode == ISD::TRUNCATE)
@@ -1274,13 +1294,8 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
           double   F;
           uint64_t I;
         } u1;
-        union {
-          double  F;
-          int64_t I;
-        } u2;
         u1.F = C1;
-        u2.F = C2;
-        if (u2.I < 0)  // Sign bit of RHS set?
+        if (int64_t(DoubleToBits(C2)) < 0)  // Sign bit of RHS set?
           u1.I |= 1ULL << 63;      // Set the sign bit of the LHS.
         else 
           u1.I &= (1ULL << 63)-1;  // Clear the sign bit of the LHS.
@@ -1316,7 +1331,11 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
       case ISD::SREM:
       case ISD::SRL:
       case ISD::SHL:
-        return getConstant(0, VT);    // fold op(undef, arg2) -> 0
+        if (!MVT::isVector(VT)) 
+          return getConstant(0, VT);    // fold op(undef, arg2) -> 0
+        // For vectors, we can't easily build an all zero vector, just return
+        // the LHS.
+        return N2;
       }
     }
   }
@@ -1343,9 +1362,17 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
     case ISD::AND:
     case ISD::SRL:
     case ISD::SHL:
-      return getConstant(0, VT);  // fold op(arg1, undef) -> 0
+      if (!MVT::isVector(VT)) 
+        return getConstant(0, VT);  // fold op(arg1, undef) -> 0
+      // For vectors, we can't easily build an all zero vector, just return
+      // the LHS.
+      return N1;
     case ISD::OR:
-      return getConstant(MVT::getIntVTBitMask(VT), VT);
+      if (!MVT::isVector(VT)) 
+        return getConstant(MVT::getIntVTBitMask(VT), VT);
+      // For vectors, we can't easily build an all one vector, just return
+      // the LHS.
+      return N1;
     case ISD::SRA:
       return N1;
     }
@@ -1473,6 +1500,15 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
            MVT::getVectorNumElements(VT) == N3.getNumOperands() &&
            "Illegal VECTOR_SHUFFLE node!");
     break;
+  case ISD::VBIT_CONVERT:
+    // Fold vbit_convert nodes from a type to themselves.
+    if (N1.getValueType() == MVT::Vector) {
+      assert(isa<ConstantSDNode>(*(N1.Val->op_end()-2)) &&
+             isa<VTSDNode>(*(N1.Val->op_end()-1)) && "Malformed vector input!");
+      if (*(N1.Val->op_end()-2) == N2 && *(N1.Val->op_end()-1) == N3)
+        return N1;
+    }
+    break;
   }
 
   // Memoize node if it doesn't produce a flag.
@@ -1511,9 +1547,7 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
 SDOperand SelectionDAG::getLoad(MVT::ValueType VT,
                                 SDOperand Chain, SDOperand Ptr,
                                 const Value *SV, int SVOffset,
-                                bool isVolatile) {
-  // FIXME: Alignment == 1 for now.
-  unsigned Alignment = 1;
+                                bool isVolatile, unsigned Alignment) {
   SDVTList VTs = getVTList(VT, MVT::Other);
   SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType());
   SDOperand Ops[] = { Chain, Ptr, Undef };
@@ -1529,6 +1563,18 @@ SDOperand SelectionDAG::getLoad(MVT::ValueType VT,
   void *IP = 0;
   if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
     return SDOperand(E, 0);
+  if (Alignment == 0) { // Ensure that codegen never sees alignment 0
+    const Type *Ty = 0;
+    if (VT != MVT::Vector && VT != MVT::iPTR) {
+      Ty = MVT::getTypeForValueType(VT);
+    } else if (SV) {
+      const PointerType *PT = dyn_cast<PointerType>(SV->getType());
+      assert(PT && "Value for load must be a pointer");
+      Ty = PT->getElementType();
+    }  
+    assert(Ty && "Could not get type information for load");
+    Alignment = TLI.getTargetData()->getABITypeAlignment(Ty);
+  }
   SDNode *N = new LoadSDNode(Ops, VTs, ISD::UNINDEXED,
                              ISD::NON_EXTLOAD, VT, SV, SVOffset, Alignment,
                              isVolatile);
@@ -1541,7 +1587,7 @@ SDOperand SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT,
                                    SDOperand Chain, SDOperand Ptr,
                                    const Value *SV,
                                    int SVOffset, MVT::ValueType EVT,
-                                   bool isVolatile) {
+                                   bool isVolatile, unsigned Alignment) {
   // If they are asking for an extending load from/to the same thing, return a
   // normal load.
   if (VT == EVT)
@@ -1556,8 +1602,6 @@ SDOperand SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT,
   assert(MVT::isInteger(VT) == MVT::isInteger(EVT) &&
          "Cannot convert from FP to Int or Int -> FP!");
 
-  // FIXME: Alignment == 1 for now.
-  unsigned Alignment = 1;
   SDVTList VTs = getVTList(VT, MVT::Other);
   SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType());
   SDOperand Ops[] = { Chain, Ptr, Undef };
@@ -1573,6 +1617,18 @@ SDOperand SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT,
   void *IP = 0;
   if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
     return SDOperand(E, 0);
+  if (Alignment == 0) { // Ensure that codegen never sees alignment 0
+    const Type *Ty = 0;
+    if (VT != MVT::Vector && VT != MVT::iPTR) {
+      Ty = MVT::getTypeForValueType(VT);
+    } else if (SV) {
+      const PointerType *PT = dyn_cast<PointerType>(SV->getType());
+      assert(PT && "Value for load must be a pointer");
+      Ty = PT->getElementType();
+    }  
+    assert(Ty && "Could not get type information for load");
+    Alignment = TLI.getTargetData()->getABITypeAlignment(Ty);
+  }
   SDNode *N = new LoadSDNode(Ops, VTs, ISD::UNINDEXED, ExtType, EVT,
                              SV, SVOffset, Alignment, isVolatile);
   CSEMap.InsertNode(N, IP);
@@ -1620,11 +1676,9 @@ SDOperand SelectionDAG::getVecLoad(unsigned Count, MVT::ValueType EVT,
 
 SDOperand SelectionDAG::getStore(SDOperand Chain, SDOperand Val,
                                  SDOperand Ptr, const Value *SV, int SVOffset,
-                                 bool isVolatile) {
+                                 bool isVolatile, unsigned Alignment) {
   MVT::ValueType VT = Val.getValueType();
 
-  // FIXME: Alignment == 1 for now.
-  unsigned Alignment = 1;
   SDVTList VTs = getVTList(MVT::Other);
   SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType());
   SDOperand Ops[] = { Chain, Val, Ptr, Undef };
@@ -1640,6 +1694,18 @@ SDOperand SelectionDAG::getStore(SDOperand Chain, SDOperand Val,
   void *IP = 0;
   if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
     return SDOperand(E, 0);
+  if (Alignment == 0) { // Ensure that codegen never sees alignment 0
+    const Type *Ty = 0;
+    if (VT != MVT::Vector && VT != MVT::iPTR) {
+      Ty = MVT::getTypeForValueType(VT);
+    } else if (SV) {
+      const PointerType *PT = dyn_cast<PointerType>(SV->getType());
+      assert(PT && "Value for store must be a pointer");
+      Ty = PT->getElementType();
+    }
+    assert(Ty && "Could not get type information for store");
+    Alignment = TLI.getTargetData()->getABITypeAlignment(Ty);
+  }
   SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, false,
                               VT, SV, SVOffset, Alignment, isVolatile);
   CSEMap.InsertNode(N, IP);
@@ -1650,7 +1716,7 @@ SDOperand SelectionDAG::getStore(SDOperand Chain, SDOperand Val,
 SDOperand SelectionDAG::getTruncStore(SDOperand Chain, SDOperand Val,
                                       SDOperand Ptr, const Value *SV,
                                       int SVOffset, MVT::ValueType SVT,
-                                      bool isVolatile) {
+                                      bool isVolatile, unsigned Alignment) {
   MVT::ValueType VT = Val.getValueType();
   bool isTrunc = VT != SVT;
 
@@ -1658,8 +1724,6 @@ SDOperand SelectionDAG::getTruncStore(SDOperand Chain, SDOperand Val,
   assert(MVT::isInteger(VT) == MVT::isInteger(SVT) &&
          "Can't do FP-INT conversion!");
 
-  // FIXME: Alignment == 1 for now.
-  unsigned Alignment = 1;
   SDVTList VTs = getVTList(MVT::Other);
   SDOperand Undef = getNode(ISD::UNDEF, Ptr.getValueType());
   SDOperand Ops[] = { Chain, Val, Ptr, Undef };
@@ -1675,6 +1739,18 @@ SDOperand SelectionDAG::getTruncStore(SDOperand Chain, SDOperand Val,
   void *IP = 0;
   if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
     return SDOperand(E, 0);
+  if (Alignment == 0) { // Ensure that codegen never sees alignment 0
+    const Type *Ty = 0;
+    if (VT != MVT::Vector && VT != MVT::iPTR) {
+      Ty = MVT::getTypeForValueType(VT);
+    } else if (SV) {
+      const PointerType *PT = dyn_cast<PointerType>(SV->getType());
+      assert(PT && "Value for store must be a pointer");
+      Ty = PT->getElementType();
+    }
+    assert(Ty && "Could not get type information for store");
+    Alignment = TLI.getTargetData()->getABITypeAlignment(Ty);
+  }
   SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, isTrunc,
                               SVT, SV, SVOffset, Alignment, isVolatile);
   CSEMap.InsertNode(N, IP);
@@ -2262,6 +2338,14 @@ SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
   SDOperand Ops[] = { Op1, Op2 };
   return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 2).Val;
 }
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+                                    MVT::ValueType VT2, MVT::ValueType VT3,
+                                    SDOperand Op1, SDOperand Op2,
+                                    SDOperand Op3) {
+  const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3);
+  SDOperand Ops[] = { Op1, Op2, Op3 };
+  return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 3).Val;
+}
 SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, 
                                     MVT::ValueType VT2, MVT::ValueType VT3,
                                     const SDOperand *Ops, unsigned NumOps) {
@@ -2537,6 +2621,17 @@ HandleSDNode::~HandleSDNode() {
   MorphNodeTo(ISD::HANDLENODE, VTs, 0, 0);  // Drops operand uses.
 }
 
+GlobalAddressSDNode::GlobalAddressSDNode(bool isTarget, const GlobalValue *GA,
+                                         MVT::ValueType VT, int o)
+  : SDNode(isa<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);
+}
 
 /// Profile - Gather unique data for the node.
 ///
@@ -2646,7 +2741,7 @@ uint64_t SDNode::getConstantOperandVal(unsigned Num) const {
   return cast<ConstantSDNode>(OperandList[Num])->getValue();
 }
 
-const char *SDNode::getOperationName(const SelectionDAG *G) const {
+std::string SDNode::getOperationName(const SelectionDAG *G) const {
   switch (getOpcode()) {
   default:
     if (getOpcode() < ISD::BUILTIN_OP_END)
@@ -2682,6 +2777,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
   case ISD::Constant:      return "Constant";
   case ISD::ConstantFP:    return "ConstantFP";
   case ISD::GlobalAddress: return "GlobalAddress";
+  case ISD::GlobalTLSAddress: return "GlobalTLSAddress";
   case ISD::FrameIndex:    return "FrameIndex";
   case ISD::JumpTable:     return "JumpTable";
   case ISD::GLOBAL_OFFSET_TABLE: return "GLOBAL_OFFSET_TABLE";
@@ -2705,6 +2801,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
   case ISD::TargetConstant: return "TargetConstant";
   case ISD::TargetConstantFP:return "TargetConstantFP";
   case ISD::TargetGlobalAddress: return "TargetGlobalAddress";
+  case ISD::TargetGlobalTLSAddress: return "TargetGlobalTLSAddress";
   case ISD::TargetFrameIndex: return "TargetFrameIndex";
   case ISD::TargetJumpTable:  return "TargetJumpTable";
   case ISD::TargetConstantPool:  return "TargetConstantPool";
@@ -2774,6 +2871,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
   case ISD::VECTOR_SHUFFLE:      return "vector_shuffle";
   case ISD::VVECTOR_SHUFFLE:     return "vvector_shuffle";
   case ISD::VBIT_CONVERT:        return "vbit_convert";
+  case ISD::CARRY_FALSE:         return "carry_false";
   case ISD::ADDC:        return "addc";
   case ISD::ADDE:        return "adde";
   case ISD::SUBC:        return "subc";