Constant‐fold an integer compare of two register operands.

Synopsis

Declared in <llvm/CodeGen/GlobalISel/Utils.h>

std::optional<SmallVector<APInt>>
ConstantFoldICmp(
    unsigned int Pred,
    Register const Op1,
    Register const Op2,
    unsigned int DstScalarSizeInBits,
    unsigned int ExtOp,
    MachineRegisterInfo const& MRI);

Return Value

The compare result vector, or std::nullopt on failure.

Parameters

Name

Description

Pred

Integer compare predicate.

Op1

First operand register.

Op2

Second operand register.

DstScalarSizeInBits

Scalar bit width of the compare result.

ExtOp

Extend opcode applied to the operands, if any.

MRI

Register information for the function.

Created with MrDocs