[llvm] 1e67385 - [MachineBlockPlacementStats] Added check for "-filter-print-funcs"

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 22:09:48 PDT 2022


Author: Mingming Liu
Date: 2022-06-16T21:59:54-07:00
New Revision: 1e67385d28a4462b3badb40373cd05d91f8ebce5

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

LOG: [MachineBlockPlacementStats] Added check for "-filter-print-funcs"
option to the machine-block-placement-stats.

Differential Revision: https://reviews.llvm.org/D128019

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachineBlockPlacement.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 19de90a94007..4cc84f22bdde 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -50,6 +50,7 @@
 #include "llvm/CodeGen/TargetSubtargetInfo.h"
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/IR/Function.h"
+#include "llvm/IR/PrintPasses.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/Allocator.h"
@@ -3659,6 +3660,9 @@ bool MachineBlockPlacementStats::runOnMachineFunction(MachineFunction &F) {
   if (std::next(F.begin()) == F.end())
     return false;
 
+  if (!isFunctionInPrintList(F.getName()))
+    return false;
+
   MBPI = &getAnalysis<MachineBranchProbabilityInfo>();
   MBFI = &getAnalysis<MachineBlockFrequencyInfo>();
 


        


More information about the llvm-commits mailing list