ΒΆllvm::Register constrainOperandRegClass(
const llvm::MachineFunction& MF,
const llvm::TargetRegisterInfo& TRI,
llvm::MachineRegisterInfo& MRI,
const llvm::TargetInstrInfo& TII,
const llvm::RegisterBankInfo& RBI,
llvm::MachineInstr& InsertPt,
const llvm::MCInstrDesc& II,
llvm::MachineOperand& RegMO,
unsigned int OpIdx)
llvm::Register constrainOperandRegClass(
const llvm::MachineFunction& MF,
const llvm::TargetRegisterInfo& TRI,
llvm::MachineRegisterInfo& MRI,
const llvm::TargetInstrInfo& TII,
const llvm::RegisterBankInfo& RBI,
llvm::MachineInstr& InsertPt,
const llvm::MCInstrDesc& II,
llvm::MachineOperand& RegMO,
unsigned int OpIdx)
Description
Try to constrain Reg so that it is usable by argument OpIdx of the provided MCInstrDesc \p II. If this fails, create a new virtual register in the correct class and insert a COPY before \p InsertPt if it is a use or after if it is a definition. In both cases, the function also updates the register of RegMo. This is equivalent to constrainOperandRegClass(..., RegClass, ...) with RegClass obtained from the MCInstrDesc. The debug location of \p InsertPt is used for the new copy.
Declared at: llvm/include/llvm/CodeGen/GlobalISel/Utils.h:121
Parameters
- const llvm::MachineFunction& MF
- const llvm::TargetRegisterInfo& TRI
- llvm::MachineRegisterInfo& MRI
- const llvm::TargetInstrInfo& TII
- const llvm::RegisterBankInfo& RBI
- llvm::MachineInstr& InsertPt
- const llvm::MCInstrDesc& II
- llvm::MachineOperand& RegMO
- unsigned int OpIdx
Returns
The virtual register constrained to the right register class.