Skip to content

Commit

Permalink
[MachineBlockPlacementStats] Add check for -filter-print-funcs opti…
Browse files Browse the repository at this point in the history
…on to machine-block-placement stats.
  • Loading branch information
minglotus-6 committed Jun 17, 2022
1 parent 04a3d5f commit 46d45df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/CodeGen/MachineBlockPlacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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>();

Expand Down

0 comments on commit 46d45df

Please sign in to comment.