Try to match Reg as an integer constant of type ConstT.

Synopsis

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

template<typename ConstT>
std::optional<ConstT>
matchConstant(
    Register Reg,
    MachineRegisterInfo const& MRI);

Specializations

Name

Description

matchConstant<APInt>

Match Reg as an APInt integer constant.

matchConstant<long>

Match Reg as a sign‐extended int64 integer constant.

Return Value

The constant value, or nullopt if matching fails.

Parameters

Name

Description

Reg

Register that may hold an integer constant.

MRI

Register info used to inspect constants.

Created with MrDocs