Remove the dead TD argument to CanEvaluateZExtd, and add a
[oota-llvm.git] / lib / Transforms / InstCombine / InstCombine.h
index a1e9f2ffe315612a76a58c293c7293df182ba7d3..536790004e864a77edc8f219857edcfa26ff9dce 100644 (file)
@@ -150,7 +150,6 @@ public:
   Instruction *FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
                                    BinaryOperator &I);
   Instruction *commonCastTransforms(CastInst &CI);
-  Instruction *commonIntCastTransforms(CastInst &CI);
   Instruction *commonPointerCastTransforms(CastInst &CI);
   Instruction *visitTrunc(TruncInst &CI);
   Instruction *visitZExt(ZExtInst &CI);
@@ -193,7 +192,18 @@ public:
   Instruction *visitInstruction(Instruction &I) { return 0; }
 
 private:
+  bool ShouldChangeType(const Type *From, const Type *To) const;
   Value *dyn_castNegVal(Value *V) const;
+  Value *dyn_castFNegVal(Value *V) const;
+  const Type *FindElementAtOffset(const Type *Ty, int64_t Offset, 
+                                  SmallVectorImpl<Value*> &NewIndices);
+  Instruction *FoldOpIntoSelect(Instruction &Op, SelectInst *SI);
+                                 
+  /// ValueRequiresCast - Return true if the cast from "V to Ty" actually
+  /// results in any code being generated.  It does not require codegen if V is
+  /// simple enough or if the cast can be folded into other casts.
+  bool ValueRequiresCast(Instruction::CastOps opcode,const Value *V,
+                         const Type *Ty);
 
   Instruction *visitCallSite(CallSite CS);
   bool transformConstExprCastCall(CallSite CS);
@@ -327,8 +337,6 @@ private:
 
   Value *EvaluateInDifferentType(Value *V, const Type *Ty, bool isSigned);
 
-  bool CanEvaluateInDifferentType(Value *V, const Type *Ty,
-                                  unsigned CastOpc, int &NumCastsRemoved);
   unsigned GetOrEnforceKnownAlignment(Value *V,
                                       unsigned PrefAlign = 0);