[llvm-commits] [polly] r163471 - in /polly/trunk: include/polly/Support/ScopHelper.h lib/Support/ScopHelper.cpp

Tobias Grosser grosser at fim.uni-passau.de
Sat Sep 8 07:00:32 PDT 2012


Author: grosser
Date: Sat Sep  8 09:00:32 2012
New Revision: 163471

URL: http://llvm.org/viewvc/llvm-project?rev=163471&view=rev
Log:
Remove dead code

This code has been replaced by the SCEVValidator a while ago.

Modified:
    polly/trunk/include/polly/Support/ScopHelper.h
    polly/trunk/lib/Support/ScopHelper.cpp

Modified: polly/trunk/include/polly/Support/ScopHelper.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/Support/ScopHelper.h?rev=163471&r1=163470&r2=163471&view=diff
==============================================================================
--- polly/trunk/include/polly/Support/ScopHelper.h (original)
+++ polly/trunk/include/polly/Support/ScopHelper.h Sat Sep  8 09:00:32 2012
@@ -43,11 +43,6 @@
 
   //===----------------------------------------------------------------------===//
   // Functions for checking affine functions.
-  bool isInvariant(const llvm::SCEV *S, llvm::Region &R);
-
-  bool isParameter(const llvm::SCEV *Var, llvm::Region &RefRegion,
-    llvm::LoopInfo &LI, llvm::ScalarEvolution &SE);
-
   bool isIndVar(const llvm::SCEV *Var, llvm::Region &RefRegion,
                 llvm::LoopInfo &LI, llvm::ScalarEvolution &SE);
 

Modified: polly/trunk/lib/Support/ScopHelper.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/ScopHelper.cpp?rev=163471&r1=163470&r2=163471&view=diff
==============================================================================
--- polly/trunk/lib/Support/ScopHelper.cpp (original)
+++ polly/trunk/lib/Support/ScopHelper.cpp Sat Sep  8 09:00:32 2012
@@ -25,96 +25,6 @@
 
 using namespace llvm;
 
-
-namespace {
-// Checks if a SCEV is invariant in a region. This is if all Values are
-// referenced in this SCEV are defined outside the region.
-class InvariantChecker: SCEVVisitor<InvariantChecker, bool> {
-  Region &R;
-
-public:
-  bool visitConstant(const SCEVConstant *S) {
-    return true;
-  }
-
-  bool visitUnknown(const SCEVUnknown *S) {
-    Value *V = S->getValue();
-
-    // An Instruction defined outside the region is invariant.
-    if (Instruction *I = dyn_cast<Instruction>(V))
-      return !R.contains(I);
-
-    // A constant is invariant.
-    return true;
-  }
-
-  bool visitNAryExpr(const SCEVNAryExpr *S) {
-    for (SCEVNAryExpr::op_iterator OI = S->op_begin(), OE = S->op_end();
-         OI != OE; ++OI)
-      if (!visit(*OI))
-        return false;
-
-    return true;
-  }
-
-  bool visitMulExpr(const SCEVMulExpr *S) {
-    return visitNAryExpr(S);
-  }
-
-  bool visitCastExpr(const SCEVCastExpr *S) {
-    return visit(S->getOperand());
-  }
-
-  bool visitTruncateExpr(const SCEVTruncateExpr *S) {
-    return visit(S->getOperand());
-  }
-
-  bool visitZeroExtendExpr(const SCEVZeroExtendExpr *S) {
-    return visit(S->getOperand());
-  }
-
-  bool visitSignExtendExpr(const SCEVSignExtendExpr *S) {
-    return visit(S->getOperand());
-  }
-
-  bool visitAddExpr(const SCEVAddExpr *S) {
-    return visitNAryExpr(S);
-  }
-
-  bool visitAddRecExpr(const SCEVAddRecExpr *S) {
-    // Check if the addrec is contained in the region.
-    if (R.contains(S->getLoop()))
-      return false;
-
-    return visitNAryExpr(S);
-  }
-
-  bool visitUDivExpr(const SCEVUDivExpr *S) {
-    return visit(S->getLHS()) && visit(S->getRHS());
-  }
-
-  bool visitSMaxExpr(const SCEVSMaxExpr *S) {
-    return visitNAryExpr(S);
-  }
-
-  bool visitUMaxExpr(const SCEVUMaxExpr *S) {
-    return visitNAryExpr(S);
-  }
-
-  bool visitCouldNotCompute(const SCEVCouldNotCompute *S) {
-    llvm_unreachable("SCEV cannot be checked");
-  }
-
-  InvariantChecker(Region &RefRegion)
-    : R(RefRegion) {}
-
-  static bool isInvariantInRegion(const SCEV *S, Region &R) {
-    InvariantChecker Checker(R);
-    return Checker.visit(S);
-  }
-};
-}
-
 // Helper function for Scop
 // TODO: Add assertion to not allow parameter to be null
 //===----------------------------------------------------------------------===//
@@ -157,38 +67,6 @@
 
 //===----------------------------------------------------------------------===//
 // Helper functions
-
-bool polly::isInvariant(const SCEV *S, Region &R) {
-  return InvariantChecker::isInvariantInRegion(S, R);
-}
-
-// Helper function to check parameter
-bool polly::isParameter(const SCEV *Var, Region &RefRegion,
-                        LoopInfo &LI, ScalarEvolution &SE) {
-  assert(Var && "Var can not be null!");
-
-  if (!isInvariant(Var, RefRegion))
-    return false;
-
-  if (isa<SCEVAddRecExpr>(Var))
-    return true;
-
-  if (const SCEVUnknown *U = dyn_cast<SCEVUnknown>(Var)) {
-    if (isa<PHINode>(U->getValue()))
-      return false;
-
-    if(isa<UndefValue>(U->getValue()))
-      return false;
-
-    return true;
-  }
-
-  if (const SCEVCastExpr *Cast = dyn_cast<SCEVCastExpr>(Var))
-    return isParameter(Cast->getOperand(), RefRegion, LI, SE);
-
-  return false;
-}
-
 bool polly::isIndVar(const SCEV *Var, Region &RefRegion,
                      LoopInfo &LI, ScalarEvolution &SE) {
   const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Var);





More information about the llvm-commits mailing list