LLVM 22.0.0git
llvm::InlineAsm::Flag Class Reference

#include "llvm/IR/InlineAsm.h"

Public Member Functions

 Flag ()
 Flag (uint32_t F)
 Flag (enum Kind K, unsigned NumOps)
 operator uint32_t ()
Kind getKind () const
bool isRegUseKind () const
bool isRegDefKind () const
bool isRegDefEarlyClobberKind () const
bool isClobberKind () const
bool isImmKind () const
bool isMemKind () const
bool isFuncKind () const
StringRef getKindName () const
unsigned getNumOperandRegisters () const
 getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag.
bool isUseOperandTiedToDef (unsigned &Idx) const
 isUseOperandTiedToDef - Return true if the flag of the inline asm operand indicates it is an use operand that's matched to a def operand.
bool hasRegClassConstraint (unsigned &RC) const
 hasRegClassConstraint - Returns true if the flag contains a register class constraint.
ConstraintCode getMemoryConstraintID () const
void setMatchingOp (unsigned OperandNo)
 setMatchingOp - Augment an existing flag with information indicating that this input operand is tied to a previous output operand.
void setRegClass (unsigned RC)
 setRegClass - Augment an existing flag with the required register class for the following register operands.
void setMemConstraint (ConstraintCode C)
 setMemConstraint - Augment an existing flag with the constraint code for a memory constraint.
void clearMemConstraint ()
 clearMemConstraint - Similar to setMemConstraint(0), but without the assertion checking that the constraint has not been set previously.
void setRegMayBeFolded (bool B)
 Set a bit to denote that while this operand is some kind of register (use, def, ...), a memory flag did appear in the original constraint list.
bool getRegMayBeFolded () const

Detailed Description

Definition at line 306 of file InlineAsm.h.

Constructor & Destructor Documentation

◆ Flag() [1/3]

llvm::InlineAsm::Flag::Flag ( )
inline

Definition at line 322 of file InlineAsm.h.

◆ Flag() [2/3]

llvm::InlineAsm::Flag::Flag ( uint32_t F)
inlineexplicit

Definition at line 323 of file InlineAsm.h.

References F.

◆ Flag() [3/3]

llvm::InlineAsm::Flag::Flag ( enum Kind K,
unsigned NumOps )
inline

Member Function Documentation

◆ clearMemConstraint()

void llvm::InlineAsm::Flag::clearMemConstraint ( )
inline

clearMemConstraint - Similar to setMemConstraint(0), but without the assertion checking that the constraint has not been set previously.

Definition at line 419 of file InlineAsm.h.

References assert(), isFuncKind(), isMemKind(), llvm::Bitfield::set(), and llvm::InlineAsm::Unknown.

◆ getKind()

Kind llvm::InlineAsm::Flag::getKind ( ) const
inline

◆ getKindName()

◆ getMemoryConstraintID()

ConstraintCode llvm::InlineAsm::Flag::getMemoryConstraintID ( ) const
inline

Definition at line 386 of file InlineAsm.h.

References assert(), llvm::Bitfield::get(), isFuncKind(), and isMemKind().

Referenced by setMemConstraint().

◆ getNumOperandRegisters()

unsigned llvm::InlineAsm::Flag::getNumOperandRegisters ( ) const
inline

getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag.

Definition at line 360 of file InlineAsm.h.

References llvm::Bitfield::get().

◆ getRegMayBeFolded()

bool llvm::InlineAsm::Flag::getRegMayBeFolded ( ) const
inline

◆ hasRegClassConstraint()

bool llvm::InlineAsm::Flag::hasRegClassConstraint ( unsigned & RC) const
inline

hasRegClassConstraint - Returns true if the flag contains a register class constraint.

Sets RC to the register class ID.

Definition at line 375 of file InlineAsm.h.

◆ isClobberKind()

bool llvm::InlineAsm::Flag::isClobberKind ( ) const
inline

Definition at line 335 of file InlineAsm.h.

References llvm::InlineAsm::Clobber, and getKind().

◆ isFuncKind()

bool llvm::InlineAsm::Flag::isFuncKind ( ) const
inline

Definition at line 338 of file InlineAsm.h.

References llvm::InlineAsm::Func, and getKind().

Referenced by clearMemConstraint(), and getMemoryConstraintID().

◆ isImmKind()

bool llvm::InlineAsm::Flag::isImmKind ( ) const
inline

Definition at line 336 of file InlineAsm.h.

References getKind(), and llvm::InlineAsm::Imm.

Referenced by setRegClass().

◆ isMemKind()

bool llvm::InlineAsm::Flag::isMemKind ( ) const
inline

◆ isRegDefEarlyClobberKind()

bool llvm::InlineAsm::Flag::isRegDefEarlyClobberKind ( ) const
inline

◆ isRegDefKind()

bool llvm::InlineAsm::Flag::isRegDefKind ( ) const
inline

◆ isRegUseKind()

bool llvm::InlineAsm::Flag::isRegUseKind ( ) const
inline

Definition at line 330 of file InlineAsm.h.

References getKind(), and llvm::InlineAsm::RegUse.

Referenced by getRegMayBeFolded(), and setRegMayBeFolded().

◆ isUseOperandTiedToDef()

bool llvm::InlineAsm::Flag::isUseOperandTiedToDef ( unsigned & Idx) const
inline

isUseOperandTiedToDef - Return true if the flag of the inline asm operand indicates it is an use operand that's matched to a def operand.

Definition at line 366 of file InlineAsm.h.

◆ operator uint32_t()

llvm::InlineAsm::Flag::operator uint32_t ( )
inline

Definition at line 328 of file InlineAsm.h.

◆ setMatchingOp()

void llvm::InlineAsm::Flag::setMatchingOp ( unsigned OperandNo)
inline

setMatchingOp - Augment an existing flag with information indicating that this input operand is tied to a previous output operand.

Definition at line 394 of file InlineAsm.h.

References assert(), and llvm::Bitfield::set().

Referenced by llvm::InlineAsmLowering::lowerInlineAsm().

◆ setMemConstraint()

void llvm::InlineAsm::Flag::setMemConstraint ( ConstraintCode C)
inline

setMemConstraint - Augment an existing flag with the constraint code for a memory constraint.

Definition at line 413 of file InlineAsm.h.

References assert(), llvm::CallingConv::C, getMemoryConstraintID(), llvm::Bitfield::set(), and llvm::InlineAsm::Unknown.

Referenced by llvm::InlineAsmLowering::lowerInlineAsm().

◆ setRegClass()

void llvm::InlineAsm::Flag::setRegClass ( unsigned RC)
inline

setRegClass - Augment an existing flag with the required register class for the following register operands.

A tied use operand cannot have a register class, use the register class from the def operand instead.

Definition at line 403 of file InlineAsm.h.

References assert(), isImmKind(), isMemKind(), and llvm::Bitfield::set().

◆ setRegMayBeFolded()

void llvm::InlineAsm::Flag::setRegMayBeFolded ( bool B)
inline

Set a bit to denote that while this operand is some kind of register (use, def, ...), a memory flag did appear in the original constraint list.

This is set by the instruction selection framework, and consumed by the register allocator. While the register allocator is generally responsible for spilling registers, we need to be able to distinguish between registers that the register allocator has permission to fold ("rm") vs ones it does not ("r"). This is because the inline asm may use instructions which don't support memory addressing modes for that operand.

Definition at line 434 of file InlineAsm.h.

References assert(), B(), isRegDefEarlyClobberKind(), isRegDefKind(), isRegUseKind(), and llvm::Bitfield::set().


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