llvm::FastISel::constrainOperandRegClass

Constrain a register operand to the class an instruction requires.

Synopsis

Declared in <llvm/CodeGen/FastISel.h>

Register
constrainOperandRegClass(
    MCInstrDesc const& II,
    Register Op,
    unsigned int OpNum);

Description

Try to constrain Op so that it is usable by argument OpNum of the provided MCInstrDesc. If this fails, create a new virtual register in the correct class and COPY the value there.

Return Value

Op if already suitable, otherwise a new constrained copy.

Parameters

NameDescription
IIDescriptor of the instruction that will use the operand.
OpRegister operand to constrain.
OpNumOperand index in II that Op will fill.