LLVM 24.0.0git
MipsOptimizePICCall.cpp File Reference

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 bool eraseGPOpnd (const MipsOptions &CLOpts, MachineInstr &MI)
 Search MI's operands for register GP and erase it.

Macro Definition Documentation

◆ DEBUG_TYPE

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

Definition at line 42 of file MipsOptimizePICCall.cpp.

Function Documentation

◆ eraseGPOpnd()

bool eraseGPOpnd ( const MipsOptions & CLOpts,
MachineInstr & MI )
static

Search MI's operands for register GP and erase it.

Definition at line 152 of file MipsOptimizePICCall.cpp.

References llvm::MachineOperand::getReg(), getRegTy(), I, llvm::MachineOperand::isReg(), llvm_unreachable, MI, and Reg.

◆ getCallTargetRegOpnd()

MachineOperand * getCallTargetRegOpnd ( MachineInstr & MI)
static

Return the first MachineOperand of MI if it is a used virtual register.

Definition at line 113 of file MipsOptimizePICCall.cpp.

References llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUse(), llvm::Register::isVirtual(), and MI.

◆ getRegTy()

◆ setCallTargetReg()

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

Do the following transformation:

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

Definition at line 139 of file MipsOptimizePICCall.cpp.

References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::TargetSubtargetInfo::getInstrInfo(), getRegTy(), llvm::MachineFunction::getSubtarget(), I, MBB, and TII.