[llvm] 1dcb936 - [NFC][Local] EliminateDuplicatePHINodes(): add STATISTIC()

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 29 12:04:19 PDT 2020


Author: Roman Lebedev
Date: 2020-08-29T22:03:18+03:00
New Revision: 1dcb936cf693b7f7abd271edc27df13425ebaac0

URL: https://github.com/llvm/llvm-project/commit/1dcb936cf693b7f7abd271edc27df13425ebaac0
DIFF: https://github.com/llvm/llvm-project/commit/1dcb936cf693b7f7abd271edc27df13425ebaac0.diff

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

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/Local.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 6aa3f051fcff..2b0ae722458b 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -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;


        


More information about the llvm-commits mailing list