Propagate TargetLibraryInfo throughout ConstantFolding.cpp and
[oota-llvm.git] / include / llvm / Analysis / ScalarEvolution.h
index 6e30b3177149296369ff48153eac7d8b20ef45cb..8661787fb98d5d37ec905f45b56de0ff8b63580b 100644 (file)
@@ -41,6 +41,7 @@ namespace llvm {
   class Type;
   class ScalarEvolution;
   class TargetData;
+  class TargetLibraryInfo;
   class LLVMContext;
   class Loop;
   class LoopInfo;
@@ -224,6 +225,10 @@ namespace llvm {
     ///
     TargetData *TD;
 
+    /// TLI - The target library information for the target we are targeting.
+    ///
+    TargetLibraryInfo *TLI;
+
     /// DT - The dominator tree.
     ///
     DominatorTree *DT;
@@ -319,8 +324,9 @@ namespace llvm {
       const SCEV *getExact(ScalarEvolution *SE) const;
 
       /// getExact - Return the number of times this loop exit may fall through
-      /// to the back edge. The loop is guaranteed not to exit via this block
-      /// before this number of iterations, but may exit via another block.
+      /// to the back edge, or SCEVCouldNotCompute. The loop is guaranteed not
+      /// to exit via this block before this number of iterations, but may exit
+      /// via another block.
       const SCEV *getExact(BasicBlock *ExitingBlock, ScalarEvolution *SE) const;
 
       /// getMax - Get the max backedge taken count for the loop.
@@ -587,6 +593,14 @@ namespace llvm {
       Ops.push_back(RHS);
       return getMulExpr(Ops, Flags);
     }
+    const SCEV *getMulExpr(const SCEV *Op0, const SCEV *Op1, const SCEV *Op2,
+                           SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap) {
+      SmallVector<const SCEV *, 3> Ops;
+      Ops.push_back(Op0);
+      Ops.push_back(Op1);
+      Ops.push_back(Op2);
+      return getMulExpr(Ops, Flags);
+    }
     const SCEV *getUDivExpr(const SCEV *LHS, const SCEV *RHS);
     const SCEV *getAddRecExpr(const SCEV *Start, const SCEV *Step,
                               const Loop *L, SCEV::NoWrapFlags Flags);