LLVM  7.0.0svn
Macros | Functions | Variables
MipsLongBranch.cpp File Reference
#include "MCTargetDesc/MipsABIInfo.h"
#include "MCTargetDesc/MipsBaseInfo.h"
#include "MCTargetDesc/MipsMCNaCl.h"
#include "MCTargetDesc/MipsMCTargetDesc.h"
#include "Mips.h"
#include "MipsInstrInfo.h"
#include "MipsMachineFunction.h"
#include "MipsSubtarget.h"
#include "MipsTargetMachine.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetMachine.h"
#include <cassert>
#include <cstdint>
#include <iterator>
Include dependency graph for MipsLongBranch.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "mips-long-branch"
 

Functions

 STATISTIC (LongBranches, "Number of long branches.")
 
 INITIALIZE_PASS (MipsLongBranch, DEBUG_TYPE, "Expand out of range branch instructions", false, false) static MachineBasicBlock *getTargetMBB(const MachineInstr &Br)
 Iterate over list of Br's operands and search for a MachineBasicBlock operand. More...
 
static ReverseIter getNonDebugInstr (ReverseIter B, const ReverseIter &E)
 
static void emitGPDisp (MachineFunction &F, const MipsInstrInfo *TII)
 

Variables

static cl::opt< boolSkipLongBranch ("skip-mips-long-branch", cl::init(false), cl::desc("MIPS: Skip long branch pass."), cl::Hidden)
 
static cl::opt< boolForceLongBranch ("force-mips-long-branch", cl::init(false), cl::desc("MIPS: Expand all branches to long format."), cl::Hidden)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "mips-long-branch"

Definition at line 46 of file MipsLongBranch.cpp.

Function Documentation

◆ emitGPDisp()

static void emitGPDisp ( MachineFunction F,
const MipsInstrInfo TII 
)
static

◆ getNonDebugInstr()

static ReverseIter getNonDebugInstr ( ReverseIter  B,
const ReverseIter &  E 
)
static

Definition at line 130 of file MipsLongBranch.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::sys::path::append(), llvm::MIBundleBuilder::append(), assert(), B, llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MachineOperand::CreateMBB(), E, llvm::WebAssembly::End, llvm::MachineBasicBlock::end(), llvm::MachineBasicBlock::getBasicBlock(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MipsSubtarget::getInstrInfo(), llvm::MipsInstrInfo::getInstSizeInBytes(), llvm::MachineBasicBlock::getNumber(), llvm::MipsInstrInfo::getOppositeBranchOpc(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getSubtarget(), llvm::MipsSubtarget::hasMips32r6(), llvm::MipsSubtarget::hasMips64r6(), I, llvm::MipsSubtarget::inMicroMipsMode(), llvm::MachineBasicBlock::insert(), llvm::MachineBasicBlock::instr_begin(), llvm::MachineBasicBlock::instr_end(), llvm::MachineOperand::isMBB(), llvm::MachineOperand::isReg(), llvm::MipsSubtarget::isTargetNaCl(), llvm::ARM_MB::LD, MI, llvm::MIPS_NACL_BUNDLE_ALIGN, llvm::MipsII::MO_ABS_HI, llvm::MipsII::MO_ABS_LO, N, RA, llvm::MachineBasicBlock::rbegin(), llvm::MachineBasicBlock::rend(), llvm::MachineBasicBlock::replaceSuccessor(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size, llvm::MachineBasicBlock::size(), splitMBB(), TII, and llvm::MipsSubtarget::useIndirectJumpsHazard().

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( MipsLongBranch  ,
DEBUG_TYPE  ,
"Expand out of range branch instructions ,
false  ,
false   
) const &

Iterate over list of Br's operands and search for a MachineBasicBlock operand.

Definition at line 112 of file MipsLongBranch.cpp.

References E, llvm::MachineOperand::getMBB(), I, llvm::MachineOperand::isMBB(), and llvm_unreachable.

◆ STATISTIC()

STATISTIC ( LongBranches  ,
"Number of long branches."   
)

Variable Documentation

◆ ForceLongBranch

cl::opt<bool> ForceLongBranch("force-mips-long-branch", cl::init(false), cl::desc("MIPS: Expand all branches to long format."), cl::Hidden)
static

Referenced by emitGPDisp().

◆ SkipLongBranch

cl::opt<bool> SkipLongBranch("skip-mips-long-branch", cl::init(false), cl::desc("MIPS: Skip long branch pass."), cl::Hidden)
static

Referenced by emitGPDisp().