Remove static global GCNames from Function.cpp and move it to the Context
[oota-llvm.git] / include / llvm / Analysis / ScalarEvolutionExpander.h
index e5647860db5c136f5d043f36f7c60931937399a4..b9939168a99d33fd17dc943ac735761e2bbcab4e 100644 (file)
@@ -117,9 +117,10 @@ namespace llvm {
 
     /// \brief Return true for expressions that may incur non-trivial cost to
     /// evaluate at runtime.
-    /// 'At' is an optional parameter which specifies point in code where user
-    /// is going to expand this expression. Sometimes this knowledge can lead to
-    /// a more accurate cost estimation.
+    ///
+    /// At is an optional parameter which specifies point in code where user is
+    /// going to expand this expression. Sometimes this knowledge can lead to a
+    /// more accurate cost estimation.
     bool isHighCostExpansion(const SCEV *Expr, Loop *L,
                              const Instruction *At = nullptr) {
       SmallPtrSet<const SCEV *, 8> Processed;
@@ -150,6 +151,22 @@ namespace llvm {
     /// block.
     Value *expandCodeFor(const SCEV *SH, Type *Ty, Instruction *I);
 
+    /// \brief Generates a code sequence that evaluates this predicate.
+    /// The inserted instructions will be at position \p Loc.
+    /// The result will be of type i1 and will have a value of 0 when the
+    /// predicate is false and 1 otherwise.
+    Value *expandCodeForPredicate(const SCEVPredicate *Pred, Instruction *Loc);
+
+    /// \brief A specialized variant of expandCodeForPredicate, handling the
+    /// case when we are expanding code for a SCEVEqualPredicate.
+    Value *expandEqualPredicate(const SCEVEqualPredicate *Pred,
+                                Instruction *Loc);
+
+    /// \brief A specialized variant of expandCodeForPredicate, handling the
+    /// case when we are expanding code for a SCEVUnionPredicate.
+    Value *expandUnionPredicate(const SCEVUnionPredicate *Pred,
+                                Instruction *Loc);
+
     /// \brief Set the current IV increment loop and position.
     void setIVIncInsertPos(const Loop *L, Instruction *Pos) {
       assert(!CanonicalMode &&
@@ -197,12 +214,14 @@ namespace llvm {
 
     void setChainedPhi(PHINode *PN) { ChainedPhis.insert(PN); }
 
-    /// \brief Try to find LLVM IR value for 'S' available at the point 'At'.
-    // 'L' is a hint which tells in which loop to look for the suitable value.
-    // On success return value which is equivalent to the expanded 'S' at point
-    // 'At'. Return nullptr if value was not found.
-    // Note that this function does not perform exhaustive search. I.e if it
-    // didn't find any value it does not mean that there is no such value.
+    /// \brief Try to find LLVM IR value for S available at the point At.
+    ///
+    /// L is a hint which tells in which loop to look for the suitable value.
+    /// On success return value which is equivalent to the expanded S at point
+    /// At. Return nullptr if value was not found.
+    ///
+    /// Note that this function does not perform an exhaustive search. I.e if it
+    /// didn't find any value it does not mean that there is no such value.
     Value *findExistingExpansion(const SCEV *S, const Instruction *At, Loop *L);
 
   private: