Skip to content

Commit

Permalink
[NewGVN] Fold single-use variables. NFCI.
Browse files Browse the repository at this point in the history
llvm-svn: 309790
  • Loading branch information
dcci committed Aug 2, 2017
1 parent b13a3fa commit c2f73b7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions llvm/lib/Transforms/Scalar/NewGVN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,11 +781,9 @@ bool StoreExpression::equals(const Expression &Other) const {

// Determine if the edge From->To is a backedge
bool NewGVN::isBackedge(BasicBlock *From, BasicBlock *To) const {
if (From == To)
return true;
auto *FromDTN = DT->getNode(From);
auto *ToDTN = DT->getNode(To);
return RPOOrdering.lookup(FromDTN) >= RPOOrdering.lookup(ToDTN);
return From == To ||
RPOOrdering.lookup(DT->getNode(From)) >=
RPOOrdering.lookup(DT->getNode(To));
}

#ifndef NDEBUG
Expand Down

0 comments on commit c2f73b7

Please sign in to comment.