Use instruction itinerary to determine what instructions are 'cheap'.
[oota-llvm.git] / include / llvm / Analysis / InstructionSimplify.h
index 13314e6ea0e5e129b38a19882bf880e3bc2c5bdd..913fd77da3c57a386e1d35f16764548816159860 100644 (file)
@@ -46,6 +46,10 @@ namespace llvm {
   Value *SimplifyFCmpInst(unsigned Predicate, Value *LHS, Value *RHS,
                           const TargetData *TD = 0);
   
+  /// SimplifySelectInst - Given operands for a SelectInst, see if we can fold
+  /// the result.  If not, this returns null.
+  Value *SimplifySelectInst(Value *Cond, Value *TrueVal, Value *FalseVal,
+                            const TargetData *TD = 0);
 
   /// SimplifyGEPInst - Given operands for an GetElementPtrInst, see if we can
   /// fold the result.  If not, this returns null.
@@ -67,6 +71,8 @@ namespace llvm {
   
   /// SimplifyInstruction - See if we can compute a simplified version of this
   /// instruction.  If not, this returns null.
+  /// WARNING: If called on unreachable code, an instruction may be reported
+  /// to simplify to itself.
   Value *SimplifyInstruction(Instruction *I, const TargetData *TD = 0);