Aggressively prune the DFS when inserting phi-defs.
[oota-llvm.git] / include / llvm / Constants.h
index bd14303d6701344be866b3faa0f41abda0362456..9ca845ec9d727784e524f6839bb3aa2481b34f22 100644 (file)
@@ -276,6 +276,12 @@ public:
     return Val.isZero() && Val.isNegative();
   }
 
+  /// isZero - Return true if the value is positive or negative zero.
+  bool isZero() const { return Val.isZero(); }
+
+  /// isNaN - Return true if the value is a NaN.
+  bool isNaN() const { return Val.isNaN(); }
+
   /// isExactlyValue - We don't rely on operator== working on double values, as
   /// it returns true for things that are clearly not equal, like -0.0 and 0.0.
   /// As such, this method can be used to do an exact bit-for-bit comparison of
@@ -685,15 +691,13 @@ public:
   // ConstantExpr class, because they will attempt to fold the constant
   // expression into something simpler if possible.
 
-  /// Cast constant expr
-  ///
-
   /// getAlignOf constant expr - computes the alignment of a type in a target
   /// independent way (Note: the return type is an i64).
   static Constant *getAlignOf(const Type* Ty);
   
-  /// getSizeOf constant expr - computes the size of a type in a target
-  /// independent way (Note: the return type is an i64).
+  /// getSizeOf constant expr - computes the (alloc) size of a type (in
+  /// address-units, not bits) in a target independent way (Note: the return
+  /// type is an i64).
   ///
   static Constant *getSizeOf(const Type* Ty);
 
@@ -919,7 +923,11 @@ DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantExpr, Constant)
 /// UndefValue - 'undef' values are things that do not have specified contents.
 /// These are used for a variety of purposes, including global variable
 /// initializers and operands to instructions.  'undef' values can occur with
-/// any type.
+/// any first-class type.
+///
+/// Undef values aren't exactly constants; if they have multiple uses, they
+/// can appear to have different bit patterns at each use. See
+/// LangRef.html#undefvalues for details.
 ///
 class UndefValue : public Constant {
   friend struct ConstantCreator<UndefValue, Type, char>;
@@ -950,6 +958,7 @@ public:
     return V->getValueID() == UndefValueVal;
   }
 };
+
 } // End llvm namespace
 
 #endif