LLVM  16.0.0git
PPCBranchSelector.cpp File Reference
#include "MCTargetDesc/PPCPredicates.h"
#include "PPC.h"
#include "PPCInstrBuilder.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>
Include dependency graph for PPCBranchSelector.cpp:

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 More...

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. More...

## ◆ DEBUG_TYPE

 #define DEBUG_TYPE   "ppc-branch-select"

Definition at line 31 of file PPCBranchSelector.cpp.

## ◆ 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 109 of file PPCBranchSelector.cpp.

## ◆ 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 73 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" )