LLVM  6.0.0svn
Macros | Functions | Variables
MipsOptimizePICCall.cpp File Reference
#include "MCTargetDesc/MipsBaseInfo.h"
#include "Mips.h"
#include "MipsRegisterInfo.h"
#include "MipsSubtarget.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/ScopedHashTable.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineDominators.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/MachineRegisterInfo.h"
#include "llvm/CodeGen/MachineValueType.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/RecyclingAllocator.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetOpcodes.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#include <cassert>
#include <utility>
#include <vector>
Include dependency graph for MipsOptimizePICCall.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "optimize-mips-pic-call"
 

Functions

static MachineOperandgetCallTargetRegOpnd (MachineInstr &MI)
 Return the first MachineOperand of MI if it is a used virtual register. More...
 
static MVT::SimpleValueType getRegTy (unsigned Reg, MachineFunction &MF)
 Return type of register Reg. More...
 
static void setCallTargetReg (MachineBasicBlock *MBB, MachineBasicBlock::iterator I)
 Do the following transformation: More...
 
static void eraseGPOpnd (MachineInstr &MI)
 Search MI's operands for register GP and erase it. More...
 

Variables

static cl::opt< boolLoadTargetFromGOT ("mips-load-target-from-got", cl::init(true), cl::desc("Load target address from GOT"), cl::Hidden)
 
static cl::opt< boolEraseGPOpnd ("mips-erase-gp-opnd", cl::init(true), cl::desc("Erase GP Operand"), cl::Hidden)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "optimize-mips-pic-call"

Definition at line 45 of file MipsOptimizePICCall.cpp.

Function Documentation

◆ eraseGPOpnd()

static void eraseGPOpnd ( MachineInstr MI)
static

◆ getCallTargetRegOpnd()

static MachineOperand* getCallTargetRegOpnd ( MachineInstr MI)
static

◆ getRegTy()

static MVT::SimpleValueType getRegTy ( unsigned  Reg,
MachineFunction MF 
)
static

◆ setCallTargetReg()

static void setCallTargetReg ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I 
)
static

Do the following transformation:

jalr $vreg => copy $t9, $vreg jalr $t9

Definition at line 152 of file MipsOptimizePICCall.cpp.

References llvm::BuildMI(), llvm::MCInstrInfo::get(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getParent(), getRegTy(), llvm::MachineFunction::getSubtarget(), llvm::MVT::i32, and TII.

Referenced by eraseGPOpnd().

Variable Documentation

◆ EraseGPOpnd

cl::opt<bool> EraseGPOpnd("mips-erase-gp-opnd", cl::init(true), cl::desc("Erase GP Operand"), cl::Hidden)
static

Referenced by eraseGPOpnd().

◆ LoadTargetFromGOT

cl::opt<bool> LoadTargetFromGOT("mips-load-target-from-got", cl::init(true), cl::desc("Load target address from GOT"), cl::Hidden)
static

Referenced by eraseGPOpnd().