LLVM API Documentation
#include "Mips.h"
#include "MCTargetDesc/MipsBaseInfo.h"
#include "MipsMachineFunction.h"
#include "MipsTargetMachine.h"
#include "llvm/ADT/ScopedHashTable.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Support/CommandLine.h"
Go to the source code of this file.
Defines | |
#define | DEBUG_TYPE "optimize-mips-pic-call" |
Functions | |
static MachineOperand * | getCallTargetRegOpnd (MachineInstr &MI) |
Return the first MachineOperand of MI if it is a used virtual register. | |
static MVT::SimpleValueType | getRegTy (unsigned Reg, MachineFunction &MF) |
Return type of register Reg. | |
static void | setCallTargetReg (MachineBasicBlock *MBB, MachineBasicBlock::iterator I) |
static void | eraseGPOpnd (MachineInstr &MI) |
Search MI's operands for register GP and erase it. | |
Variables | |
static cl::opt< bool > | LoadTargetFromGOT ("mips-load-target-from-got", cl::init(true), cl::desc("Load target address from GOT"), cl::Hidden) |
static cl::opt< bool > | EraseGPOpnd ("mips-erase-gp-opnd", cl::init(true), cl::desc("Erase GP Operand"), cl::Hidden) |
#define DEBUG_TYPE "optimize-mips-pic-call" |
Definition at line 26 of file MipsOptimizePICCall.cpp.
static void eraseGPOpnd | ( | MachineInstr & | MI | ) | [static] |
Search MI's operands for register GP and erase it.
Definition at line 142 of file MipsOptimizePICCall.cpp.
References EraseGPOpnd, llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getReg(), getRegTy(), I, llvm::MVT::i32, llvm::MachineOperand::isReg(), llvm_unreachable, and llvm::MachineInstr::RemoveOperand().
static MachineOperand* getCallTargetRegOpnd | ( | MachineInstr & | MI | ) | [static] |
Return the first MachineOperand of MI if it is a used virtual register.
Definition at line 104 of file MipsOptimizePICCall.cpp.
References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUse(), and llvm::TargetRegisterInfo::isVirtualRegister().
static MVT::SimpleValueType getRegTy | ( | unsigned | Reg, |
MachineFunction & | MF | ||
) | [static] |
Return type of register Reg.
Definition at line 118 of file MipsOptimizePICCall.cpp.
References llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::TargetRegisterClass::vt_begin(), and llvm::TargetRegisterClass::vt_end().
Referenced by eraseGPOpnd(), and setCallTargetReg().
static void setCallTargetReg | ( | MachineBasicBlock * | MBB, |
MachineBasicBlock::iterator | I | ||
) | [static] |
Do the following transformation:
jalr $vreg => copy $t9, $vreg jalr $t9
Definition at line 130 of file MipsOptimizePICCall.cpp.
References llvm::BuildMI(), llvm::TargetOpcode::COPY, llvm::MCInstrInfo::get(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getParent(), getRegTy(), llvm::MachineFunction::getSubtarget(), llvm::MVT::i32, and TII.
cl::opt<bool> EraseGPOpnd("mips-erase-gp-opnd", cl::init(true), cl::desc("Erase GP Operand"), cl::Hidden) [static] |
Referenced by eraseGPOpnd().
cl::opt<bool> LoadTargetFromGOT("mips-load-target-from-got", cl::init(true), cl::desc("Load target address from GOT"), cl::Hidden) [static] |