ΒΆllvm::Register constrainRegToClass(
    llvm::MachineRegisterInfo& MRI,
    const llvm::TargetInstrInfo& TII,
    const llvm::RegisterBankInfo& RBI,
    llvm::Register Reg,
    const llvm::TargetRegisterClass& RegClass)

Description

Try to constrain Reg to the specified register class. If this fails, create a new virtual register in the correct class.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/Utils.h:89

Parameters

llvm::MachineRegisterInfo& MRI
const llvm::TargetInstrInfo& TII
const llvm::RegisterBankInfo& RBI
llvm::Register Reg
const llvm::TargetRegisterClass& RegClass

Returns

The virtual register constrained to the right register class.