LLVM 20.0.0git
Macros | Functions
PPCBranchSelector.cpp File Reference
#include "MCTargetDesc/PPCPredicates.h"
#include "PPC.h"
#include "PPCInstrInfo.h"
#include "PPCSubtarget.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetMachine.h"
#include <algorithm>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "ppc-branch-select"
 

Functions

 STATISTIC (NumExpanded, "Number of branches expanded to long format")
 
 STATISTIC (NumPrefixed, "Number of prefixed instructions")
 
 STATISTIC (NumPrefixedAligned, "Number of prefixed instructions that have been aligned")
 
 INITIALIZE_PASS (PPCBSel, "ppc-branch-select", "PowerPC Branch Selector", false, false) FunctionPass *llvm
 createPPCBranchSelectionPass - returns an instance of the Branch Selection Pass
 
static unsigned GetInitialOffset (MachineFunction &Fn)
 We need to be careful about the offset of the first block in the function because it might not have the function's alignment.
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "ppc-branch-select"

Definition at line 30 of file PPCBranchSelector.cpp.

Function Documentation

◆ GetInitialOffset()

static unsigned GetInitialOffset ( MachineFunction Fn)
inlinestatic

We need to be careful about the offset of the first block in the function because it might not have the function's alignment.

This happens because, under the ELFv2 ABI, for functions which require a TOC pointer, we add a two-instruction sequence to the start of the function. Note: This needs to be synchronized with the check in PPCLinuxAsmPrinter::EmitFunctionBodyStart.

Definition at line 108 of file PPCBranchSelector.cpp.

References llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::PPCSubtarget::isELFv2ABI(), and llvm::MachineRegisterInfo::use_empty().

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( PPCBSel  ,
"ppc-branch-select"  ,
"PowerPC Branch Selector"  ,
false  ,
false   
)

createPPCBranchSelectionPass - returns an instance of the Branch Selection Pass

Definition at line 72 of file PPCBranchSelector.cpp.

◆ STATISTIC() [1/3]

STATISTIC ( NumExpanded  ,
"Number of branches expanded to long format"   
)

◆ STATISTIC() [2/3]

STATISTIC ( NumPrefixed  ,
"Number of prefixed instructions"   
)

◆ STATISTIC() [3/3]

STATISTIC ( NumPrefixedAligned  ,
"Number of prefixed instructions that have been aligned"   
)