Generalize the "trunc(ptrtoint(x)) - trunc(ptrtoint(y)) ->
[oota-llvm.git] / include / llvm / Analysis / InstructionSimplify.h
index d85ae4f2a482519a6ee7c2e883c99758a5be7658..fb07b03aeb3649693a7f9801b4f4da105164ed75 100644 (file)
 #define LLVM_ANALYSIS_INSTRUCTIONSIMPLIFY_H
 
 namespace llvm {
+  template<typename T>
+  class ArrayRef;
   class DominatorTree;
   class Instruction;
-  class Value;
   class TargetData;
   class TargetLibraryInfo;
-  template<typename T>
-  class ArrayRef;
+  class Type;
+  class Value;
 
   /// SimplifyAddInst - Given operands for an Add, see if we can
   /// fold the result.  If not, this returns null.
@@ -158,6 +159,12 @@ namespace llvm {
                                  const TargetLibraryInfo *TLI = 0,
                                  const DominatorTree *DT = 0);
 
+  /// SimplifyTruncInst - Given operands for an TruncInst, see if we can fold
+  /// the result.  If not, this returns null.
+  Value *SimplifyTruncInst(Value *Op, Type *Ty, const TargetData *TD = 0,
+                           const TargetLibraryInfo *TLI = 0,
+                           const DominatorTree *DT = 0);
+
   //=== Helper functions for higher up the class hierarchy.