[llvm] r303443 - NewGVN: Get rid of most dominating leader check
Daniel Berlin via llvm-commits
llvm-commits at lists.llvm.org
Fri May 19 12:01:25 PDT 2017
Author: dannyb
Date: Fri May 19 14:01:24 2017
New Revision: 303443
URL: http://llvm.org/viewvc/llvm-project?rev=303443&view=rev
Log:
NewGVN: Get rid of most dominating leader check
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=303443&r1=303442&r2=303443&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Fri May 19 14:01:24 2017
@@ -104,8 +104,6 @@ STATISTIC(NumGVNLeaderChanges, "Number o
STATISTIC(NumGVNSortedLeaderChanges, "Number of sorted leader changes");
STATISTIC(NumGVNAvoidedSortedLeaderChanges,
"Number of avoided sorted leader changes");
-STATISTIC(NumGVNNotMostDominatingLeader,
- "Number of times a member dominated it's new classes' leader");
STATISTIC(NumGVNDeadStores, "Number of redundant/dead stores eliminated");
DEBUG_COUNTER(VNCounter, "newgvn-vn",
"Controls which instructions are value numbered")
@@ -1946,31 +1944,11 @@ void NewGVN::moveValueToNewCongruenceCla
if (I == OldClass->getNextLeader().first)
OldClass->resetNextLeader();
- // It's possible, though unlikely, for us to discover equivalences such
- // that the current leader does not dominate the old one.
- // This statistic tracks how often this happens.
- // We assert on phi nodes when this happens, currently, for debugging, because
- // we want to make sure we name phi node cycles properly.
- if (isa<Instruction>(NewClass->getLeader()) && NewClass->getLeader() &&
- I != NewClass->getLeader()) {
- auto *IBB = I->getParent();
- auto *NCBB = cast<Instruction>(NewClass->getLeader())->getParent();
- bool Dominated =
- IBB == NCBB && InstrToDFSNum(I) < InstrToDFSNum(NewClass->getLeader());
- Dominated = Dominated || DT->properlyDominates(IBB, NCBB);
- if (Dominated) {
- ++NumGVNNotMostDominatingLeader;
- assert(
- !isa<PHINode>(I) &&
- "New class for instruction should not be dominated by instruction");
- }
- }
+ OldClass->erase(I);
+ NewClass->insert(I);
if (NewClass->getLeader() != I)
NewClass->addPossibleNextLeader({I, InstrToDFSNum(I)});
-
- OldClass->erase(I);
- NewClass->insert(I);
// Handle our special casing of stores.
if (auto *SI = dyn_cast<StoreInst>(I)) {
OldClass->decStoreCount();
More information about the llvm-commits
mailing list