]> granicus.if.org Git - llvm/commitdiff
[NewGVN] isOnlyReachableViaThisEdge() is dead now. NFCI.
authorDavide Italiano <davide@freebsd.org>
Fri, 17 Feb 2017 22:12:30 +0000 (22:12 +0000)
committerDavide Italiano <davide@freebsd.org>
Fri, 17 Feb 2017 22:12:30 +0000 (22:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295503 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/NewGVN.cpp

index d09a1daf60874f8e26e00fa264fd57781a0acd0a..6f147d74bbd5b45938fb894ed3386c89e3dbbfa9 100644 (file)
@@ -362,7 +362,6 @@ private:
   // Reachability handling.
   void updateReachableEdge(BasicBlock *, BasicBlock *);
   void processOutgoingEdges(TerminatorInst *, BasicBlock *);
-  bool isOnlyReachableViaThisEdge(const BasicBlockEdge &) const;
   Value *findConditionEquivalence(Value *) const;
 
   // Elimination.
@@ -1069,23 +1068,6 @@ const Expression *NewGVN::performSymbolicEvaluation(Value *V) {
   return E;
 }
 
-// There is an edge from 'Src' to 'Dst'.  Return true if every path from
-// the entry block to 'Dst' passes via this edge.  In particular 'Dst'
-// must not be reachable via another edge from 'Src'.
-bool NewGVN::isOnlyReachableViaThisEdge(const BasicBlockEdge &E) const {
-
-  // While in theory it is interesting to consider the case in which Dst has
-  // more than one predecessor, because Dst might be part of a loop which is
-  // only reachable from Src, in practice it is pointless since at the time
-  // GVN runs all such loops have preheaders, which means that Dst will have
-  // been changed to have only one predecessor, namely Src.
-  const BasicBlock *Pred = E.getEnd()->getSinglePredecessor();
-  const BasicBlock *Src = E.getStart();
-  assert((!Pred || Pred == Src) && "No edge between these basic blocks!");
-  (void)Src;
-  return Pred != nullptr;
-}
-
 void NewGVN::markUsersTouched(Value *V) {
   // Now mark the users as touched.
   for (auto *User : V->users()) {