LLVM 20.0.0git
|
#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/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/CodeGenTypes/MachineValueType.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/RecyclingAllocator.h"
#include <cassert>
#include <utility>
Go to the source code of this file.
Macros | |
#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) |
Do the following transformation: | |
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 43 of file MipsOptimizePICCall.cpp.
|
static |
Search MI's operands for register GP and erase it.
Definition at line 161 of file MipsOptimizePICCall.cpp.
References EraseGPOpnd, llvm::MachineOperand::getReg(), getRegTy(), I, llvm::MachineOperand::isReg(), llvm_unreachable, and MI.
|
static |
Return the first MachineOperand of MI if it is a used virtual register.
Definition at line 123 of file MipsOptimizePICCall.cpp.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUse(), llvm::Register::isVirtual(), and MI.
|
static |
Return type of register Reg.
Definition at line 136 of file MipsOptimizePICCall.cpp.
References assert(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), and TRI.
Referenced by eraseGPOpnd(), and setCallTargetReg().
|
static |
Do the following transformation:
jalr $vreg => copy $t9, $vreg jalr $t9
Definition at line 149 of file MipsOptimizePICCall.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getParent(), getRegTy(), llvm::MachineFunction::getSubtarget(), I, MBB, and TII.
|
static |
Referenced by eraseGPOpnd().