[llvm] r295503 - [NewGVN] isOnlyReachableViaThisEdge() is dead now. NFCI.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 17 14:12:30 PST 2017
Author: davide
Date: Fri Feb 17 16:12:30 2017
New Revision: 295503
URL: http://llvm.org/viewvc/llvm-project?rev=295503&view=rev
Log:
[NewGVN] isOnlyReachableViaThisEdge() is dead now. NFCI.
Modified:
llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=295503&r1=295502&r2=295503&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Fri Feb 17 16:12:30 2017
@@ -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::performSymboli
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()) {
More information about the llvm-commits
mailing list