LLVM 20.0.0git
Public Member Functions | List of all members
llvm::RegOrConstant Class Reference

Represents a value which can be a Register or a constant. More...

#include "llvm/CodeGen/GlobalISel/Utils.h"

Public Member Functions

 RegOrConstant (Register Reg)
 
 RegOrConstant (int64_t Cst)
 
bool isReg () const
 
bool isCst () const
 
Register getReg () const
 
int64_t getCst () const
 

Detailed Description

Represents a value which can be a Register or a constant.

This is useful in situations where an instruction may have an interesting register operand or interesting constant operand. For a concrete example,

See also
getVectorSplat.

Definition at line 395 of file Utils.h.

Constructor & Destructor Documentation

◆ RegOrConstant() [1/2]

llvm::RegOrConstant::RegOrConstant ( Register  Reg)
inlineexplicit

Definition at line 401 of file Utils.h.

◆ RegOrConstant() [2/2]

llvm::RegOrConstant::RegOrConstant ( int64_t  Cst)
inlineexplicit

Definition at line 402 of file Utils.h.

Member Function Documentation

◆ getCst()

int64_t llvm::RegOrConstant::getCst ( ) const
inline

Definition at line 409 of file Utils.h.

References assert(), and isCst().

◆ getReg()

Register llvm::RegOrConstant::getReg ( ) const
inline

Definition at line 405 of file Utils.h.

References assert(), and isReg().

◆ isCst()

bool llvm::RegOrConstant::isCst ( ) const
inline

Definition at line 404 of file Utils.h.

Referenced by getCst().

◆ isReg()

bool llvm::RegOrConstant::isReg ( ) const
inline

Definition at line 403 of file Utils.h.

Referenced by getReg().


The documentation for this class was generated from the following file: