[NFC][Local] EliminateDuplicatePHINodes(): add STATISTIC()

This commit is contained in:
Roman Lebedev 2020-08-29 22:02:35 +03:00
parent 961483a5ea
commit 1dcb936cf6
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
1 changed files with 2 additions and 0 deletions

View File

@ -91,6 +91,7 @@ using namespace llvm::PatternMatch;
#define DEBUG_TYPE "local"
STATISTIC(NumRemoved, "Number of unreachable basic blocks removed");
STATISTIC(NumPHICSEs, "Number of PHI's that got CSE'd");
static cl::opt<bool> PHICSEDebugHash(
"phicse-debug-hash",
@ -1194,6 +1195,7 @@ bool llvm::EliminateDuplicatePHINodes(BasicBlock *BB) {
auto Inserted = PHISet.insert(PN);
if (!Inserted.second) {
// A duplicate. Replace this PHI with its duplicate.
++NumPHICSEs;
PN->replaceAllUsesWith(*Inserted.first);
PN->eraseFromParent();
Changed = true;