1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00

NewGVN: Get rid of most dominating leader check

llvm-svn: 303443
This commit is contained in:
Daniel Berlin 2017-05-19 19:01:24 +00:00
parent 090cfd56ce
commit 6cc057f1a8

View File

@ -104,8 +104,6 @@ STATISTIC(NumGVNLeaderChanges, "Number of leader changes");
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::moveValueToNewCongruenceClass(Instruction *I, const Expression *E,
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();