Skip to content

Commit

Permalink
[MC][PGO][PGSO] Cleanup unused MBFI in AsmPrinter
Browse files Browse the repository at this point in the history
Summary:
Machine Block Frequency Info (MBFI) is being computed but unused in AsmPrinter.

MBFI computation was introduced with PGO change D71149 and then its use was
removed in D71106. No need to keep computing it.

Reviewers: MaskRay, jyknight, skan, yamauchi, davidxl, efriedma, huihuiz

Reviewed By: MaskRay, skan, yamauchi

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78526
  • Loading branch information
apazos committed Apr 21, 2020
1 parent fccc4af commit 66590e1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
6 changes: 0 additions & 6 deletions llvm/include/llvm/CodeGen/AsmPrinter.h
Expand Up @@ -48,7 +48,6 @@ class GlobalObject;
class GlobalValue;
class GlobalVariable;
class MachineBasicBlock;
class MachineBlockFrequencyInfo;
class MachineConstantPoolValue;
class MachineDominatorTree;
class MachineFunction;
Expand All @@ -69,7 +68,6 @@ class MCSymbol;
class MCTargetOptions;
class MDNode;
class Module;
class ProfileSummaryInfo;
class raw_ostream;
class StackMaps;
class TargetLoweringObjectFile;
Expand Down Expand Up @@ -112,10 +110,6 @@ class AsmPrinter : public MachineFunctionPass {
/// Optimization remark emitter.
MachineOptimizationRemarkEmitter *ORE;

MachineBlockFrequencyInfo *MBFI;

ProfileSummaryInfo *PSI;

/// The symbol for the entry in __patchable_function_entires.
MCSymbol *CurrentPatchableFunctionEntrySym = nullptr;

Expand Down
13 changes: 0 additions & 13 deletions llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Expand Up @@ -31,16 +31,13 @@
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/CodeGen/GCMetadata.h"
#include "llvm/CodeGen/GCMetadataPrinter.h"
#include "llvm/CodeGen/GCStrategy.h"
#include "llvm/CodeGen/LazyMachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
Expand All @@ -55,7 +52,6 @@
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
#include "llvm/CodeGen/MachineSizeOpts.h"
#include "llvm/CodeGen/StackMaps.h"
#include "llvm/CodeGen/TargetFrameLowering.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
Expand Down Expand Up @@ -251,8 +247,6 @@ void AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<MachineModuleInfoWrapperPass>();
AU.addRequired<MachineOptimizationRemarkEmitterPass>();
AU.addRequired<GCModuleInfo>();
AU.addRequired<LazyMachineBlockFrequencyInfoPass>();
AU.addRequired<ProfileSummaryInfoWrapperPass>();
}

bool AsmPrinter::doInitialization(Module &M) {
Expand Down Expand Up @@ -1781,13 +1775,6 @@ void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
}

ORE = &getAnalysis<MachineOptimizationRemarkEmitterPass>().getORE();
PSI = &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();
MBFI = (PSI && PSI->hasProfileSummary()) ?
// ORE conditionally computes MBFI. If available, use it, otherwise
// request it.
(ORE->getBFI() ? ORE->getBFI() :
&getAnalysis<LazyMachineBlockFrequencyInfoPass>().getBFI()) :
nullptr;
}

namespace {
Expand Down

0 comments on commit 66590e1

Please sign in to comment.