28#define DEBUG_TYPE "tailduplication"
34 std::unique_ptr<MBFIWrapper> MBFIW;
37 TailDuplicateBase(
char &PassID,
bool PreRegAlloc)
50class TailDuplicate :
public TailDuplicateBase {
53 TailDuplicate() : TailDuplicateBase(
ID,
false) {
58class EarlyTailDuplicate :
public TailDuplicateBase {
61 EarlyTailDuplicate() : TailDuplicateBase(
ID,
true) {
67 .
set(MachineFunctionProperties::Property::NoPHIs);
73char TailDuplicate::ID;
74char EarlyTailDuplicate::ID;
84 if (skipFunction(MF.getFunction()))
87 auto MBPI = &getAnalysis<MachineBranchProbabilityInfoWrapperPass>().getMBPI();
88 auto *PSI = &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();
89 auto *MBFI = (PSI && PSI->hasProfileSummary()) ?
90 &getAnalysis<LazyMachineBlockFrequencyInfoPass>().getBFI() :
93 MBFIW = std::make_unique<MBFIWrapper>(*MBFI);
94 Duplicator.initMF(MF, PreRegAlloc, MBPI, MBFI ? MBFIW.get() :
nullptr, PSI,
97 bool MadeChange =
false;
98 while (Duplicator.tailDuplicateBlocks())
===- LazyMachineBlockFrequencyInfo.h - Lazy Block Frequency -*- C++ -*–===//
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
This is an alternative analysis pass to MachineBlockFrequencyInfo.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
Properties which a MachineFunction may have at a given point in time.
MachineFunctionProperties & set(Property P)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
An analysis pass based on legacy pass manager to deliver ProfileSummaryInfo.
Utility class to perform tail duplication.
@ Tail
Attemps to make calls as fast as possible while guaranteeing that tail call optimization can always b...
This is an optimization pass for GlobalISel generic memory operations.
char & EarlyTailDuplicateID
Duplicate blocks with unconditional branches into tails of their predecessors.
char & TailDuplicateID
TailDuplicate - Duplicate blocks with unconditional branches into tails of their predecessors.
void initializeEarlyTailDuplicatePass(PassRegistry &)
void initializeTailDuplicatePass(PassRegistry &)