Resolve a terrible hack in tblgen: instead of hardcoding
[oota-llvm.git] / include / llvm / Analysis / ScalarEvolutionExpressions.h
index dca62727324823be85182b190fda8f4a4c28817f..4213a287011b56043549dbc6a7d2290351a27f5f 100644 (file)
@@ -126,12 +126,6 @@ namespace llvm {
   public:
     virtual void print(raw_ostream &OS) const;
 
-    virtual bool hasComputableLoopEvolution(const Loop *QL) const {
-      // Not computable. A truncate of an addrec is always folded into
-      // the addrec.
-      return false;
-    }
-
     /// Methods for support type inquiry through isa, cast, and dyn_cast:
     static inline bool classof(const SCEVTruncateExpr *S) { return true; }
     static inline bool classof(const SCEV *S) {
@@ -208,33 +202,14 @@ namespace llvm {
     op_iterator op_begin() const { return Operands; }
     op_iterator op_end() const { return Operands + NumOperands; }
 
-    virtual bool isLoopInvariant(const Loop *L) const {
-      for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
-        if (!getOperand(i)->isLoopInvariant(L)) return false;
-      return true;
-    }
+    virtual bool isLoopInvariant(const Loop *L) const;
 
     // hasComputableLoopEvolution - N-ary expressions have computable loop
     // evolutions iff they have at least one operand that varies with the loop,
     // but that all varying operands are computable.
-    virtual bool hasComputableLoopEvolution(const Loop *L) const {
-      bool HasVarying = false;
-      for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
-        if (!getOperand(i)->isLoopInvariant(L)) {
-          if (getOperand(i)->hasComputableLoopEvolution(L))
-            HasVarying = true;
-          else
-            return false;
-        }
-      return HasVarying;
-    }
+    virtual bool hasComputableLoopEvolution(const Loop *L) const;
 
-    virtual bool hasOperand(const SCEV *O) const {
-      for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
-        if (O == getOperand(i) || getOperand(i)->hasOperand(O))
-          return true;
-      return false;
-    }
+    virtual bool hasOperand(const SCEV *O) const;
 
     bool dominates(BasicBlock *BB, DominatorTree *DT) const;
 
@@ -300,12 +275,6 @@ namespace llvm {
     }
 
   public:
-    virtual bool hasComputableLoopEvolution(const Loop *QL) const {
-      // Not computable. An add of an addrec is always folded into the addrec
-      // if the other operands are loop-variant or loop-computable.
-      return false;
-    }
-
     virtual const char *getOperationStr() const { return " + "; }
 
     virtual const Type *getType() const {
@@ -334,12 +303,6 @@ namespace llvm {
     }
 
   public:
-    virtual bool hasComputableLoopEvolution(const Loop *QL) const {
-      // Not computable. A mul of an addrec is always folded into the addrec
-      // if the other operands are loop-variant or loop-computable.
-      return false;
-    }
-
     virtual const char *getOperationStr() const { return " * "; }
 
     /// Methods for support type inquiry through isa, cast, and dyn_cast: