From c6bb55ba538e3a6efe1f2ead2ff837a0f4bd9e0f Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 7 May 2009 14:00:19 +0000 Subject: Factor out a common base class between SCEVCommutativeExpr and SCEVAddRecExpr. This eliminates redundant code for visiting all the operands of an expression. llvm-svn: 71157 --- llvm/lib/Analysis/ScalarEvolution.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp') diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 50cece03657..e00d1d9f806 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -316,7 +316,7 @@ replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, return this; } -bool SCEVCommutativeExpr::dominates(BasicBlock *BB, DominatorTree *DT) const { +bool SCEVNAryExpr::dominates(BasicBlock *BB, DominatorTree *DT) const { for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { if (!getOperand(i)->dominates(BB, DT)) return false; @@ -359,15 +359,6 @@ SCEVAddRecExpr::~SCEVAddRecExpr() { SCEVAddRecExprs->erase(std::make_pair(L, SCEVOps)); } -bool SCEVAddRecExpr::dominates(BasicBlock *BB, DominatorTree *DT) const { - for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { - if (!getOperand(i)->dominates(BB, DT)) - return false; - } - return true; -} - - SCEVHandle SCEVAddRecExpr:: replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, const SCEVHandle &Conc, -- cgit v1.2.3