[PATCH] D33608: [Analysis] RemoveTotalMemInst counting in InstCount to avoid reading back other Statistic variables

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 11:21:33 PDT 2017


craig.topper updated this revision to Diff 100741.
craig.topper retitled this revision from "[Analysis] Rewrite TotalMemInst counting in InstCount pass in a way that doesn't require reading back other Statistic variables" to "[Analysis] RemoveTotalMemInst counting in InstCount to avoid reading back other Statistic variables".
craig.topper edited the summary of this revision.
craig.topper added a comment.

Just remove the TotalMemInst counter


https://reviews.llvm.org/D33608

Files:
  lib/Analysis/InstCount.cpp


Index: lib/Analysis/InstCount.cpp
===================================================================
--- lib/Analysis/InstCount.cpp
+++ lib/Analysis/InstCount.cpp
@@ -26,7 +26,6 @@
 STATISTIC(TotalInsts , "Number of instructions (of all types)");
 STATISTIC(TotalBlocks, "Number of basic blocks");
 STATISTIC(TotalFuncs , "Number of non-external functions");
-STATISTIC(TotalMemInst, "Number of memory instructions");
 
 #define HANDLE_INST(N, OPCODE, CLASS) \
   STATISTIC(Num ## OPCODE ## Inst, "Number of " #OPCODE " insts");
@@ -76,13 +75,6 @@
 // function.
 //
 bool InstCount::runOnFunction(Function &F) {
-  unsigned StartMemInsts =
-    NumGetElementPtrInst + NumLoadInst + NumStoreInst + NumCallInst +
-    NumInvokeInst + NumAllocaInst;
   visit(F);
-  unsigned EndMemInsts =
-    NumGetElementPtrInst + NumLoadInst + NumStoreInst + NumCallInst +
-    NumInvokeInst + NumAllocaInst;
-  TotalMemInst += EndMemInsts-StartMemInsts;
   return false;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33608.100741.patch
Type: text/x-patch
Size: 960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170530/c041655c/attachment.bin>


More information about the llvm-commits mailing list