Now that Reassociate's LinearizeExprTree can look through arbitrary expression
[oota-llvm.git] / include / llvm / Constants.h
index 0abe17d365d4e83cc9c704bdba8670e83db3612d..a3f5b95dbcc7f0851995d53dfc959b0ab5f99a20 100644 (file)
@@ -917,6 +917,11 @@ public:
     return getLShr(C1, C2, true);
   }
 
+  /// getBinOpIdentity - Return the identity for the given binary operation,
+  /// i.e. a constant C such that X op C = X and C op X = X for every X.  It
+  /// is an error to call this for an operation that doesn't have an identity.
+  static Constant *getBinOpIdentity(unsigned Opcode, Type *Ty);
+
   /// Transparently provide more efficient getOperand methods.
   DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);