Added isUndef() interface for SDNode
authorElena Demikhovsky <elena.demikhovsky@intel.com>
Thu, 10 Sep 2015 06:33:13 +0000 (06:33 +0000)
committerElena Demikhovsky <elena.demikhovsky@intel.com>
Thu, 10 Sep 2015 06:33:13 +0000 (06:33 +0000)
Differential Revision: http://reviews.llvm.org/D12720

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247246 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGNodes.h

index 4821d1aae9e5244a6cf7799780cfd0976a00133e..eefa76d37d6fa0375a00c3d6e21c00dd7853b7f9 100644 (file)
@@ -167,6 +167,7 @@ public:
   inline bool isTargetMemoryOpcode() const;
   inline bool isTargetOpcode() const;
   inline bool isMachineOpcode() const;
+  inline bool isUndef() const;
   inline unsigned getMachineOpcode() const;
   inline const DebugLoc &getDebugLoc() const;
   inline void dump() const;
@@ -395,6 +396,9 @@ public:
     return NodeType >= ISD::FIRST_TARGET_MEMORY_OPCODE;
   }
 
+  /// Return true if the type of the node type undefined.
+  bool isUndef() const { return NodeType == ISD::UNDEF; }
+
   /// Test if this node is a memory intrinsic (with valid pointer information).
   /// INTRINSIC_W_CHAIN and INTRINSIC_VOID nodes are sometimes created for
   /// non-memory intrinsics (with chains) that are not really instances of
@@ -909,6 +913,9 @@ inline bool SDValue::isMachineOpcode() const {
 inline unsigned SDValue::getMachineOpcode() const {
   return Node->getMachineOpcode();
 }
+inline bool SDValue::isUndef() const {
+  return Node->isUndef();
+}
 inline bool SDValue::use_empty() const {
   return !Node->hasAnyUseOfValue(ResNo);
 }