Refactor the constant folding code into it's own function. And call it from both
[oota-llvm.git] / include / llvm / CodeGen / SelectionDAG.h
index 95c30c6219ae84895d9950f333d0e772e3a80930..6ca8a8c861f8f5431b37592a320033bf8bcd24fb 100644 (file)
@@ -697,9 +697,15 @@ public:
   /// at least that alignment.
   SDValue CreateStackTemporary(MVT VT, unsigned minAlign = 1);
   
+  /// FoldConstantArithmetic - 
+  SDValue FoldConstantArithmetic(unsigned Opcode,
+                                 MVT VT,
+                                 ConstantSDNode *Cst1,
+                                 ConstantSDNode *Cst2);
+
   /// FoldSetCC - Constant fold a setcc to true or false.
   SDValue FoldSetCC(MVT VT, SDValue N1,
-                      SDValue N2, ISD::CondCode Cond);
+                    SDValue N2, ISD::CondCode Cond);
   
   /// SignBitIsZero - Return true if the sign bit of Op is known to be zero.  We
   /// use this predicate to simplify operations downstream.