LLVM 19.0.0git
Public Member Functions | List of all members
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 303 of file InlineAsm.h.

Constructor & Destructor Documentation

◆ Flag() [1/3]

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

Definition at line 319 of file InlineAsm.h.

◆ Flag() [2/3]

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

Definition at line 320 of file InlineAsm.h.

◆ Flag() [3/3]

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

Definition at line 321 of file InlineAsm.h.

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 416 of file InlineAsm.h.

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

◆ getKind()

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

◆ getKindName()

StringRef llvm::InlineAsm::Flag::getKindName ( ) const
inline

◆ getMemoryConstraintID()

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

Definition at line 383 of file InlineAsm.h.

References assert(), 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 357 of file InlineAsm.h.

Referenced by llvm::AVRAsmPrinter::PrintAsmMemoryOperand(), and llvm::AVRAsmPrinter::PrintAsmOperand().

◆ getRegMayBeFolded()

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

Definition at line 436 of file InlineAsm.h.

References assert(), isRegDefEarlyClobberKind(), isRegDefKind(), and isRegUseKind().

◆ 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 372 of file InlineAsm.h.

◆ isClobberKind()

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

Definition at line 332 of file InlineAsm.h.

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

◆ isFuncKind()

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

Definition at line 335 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 333 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 327 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 363 of file InlineAsm.h.

References Idx.

◆ operator uint32_t()

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

Definition at line 325 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 391 of file InlineAsm.h.

References assert().

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 410 of file InlineAsm.h.

References assert(), llvm::CallingConv::C, getMemoryConstraintID(), 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 400 of file InlineAsm.h.

References assert(), isImmKind(), and isMemKind().

◆ 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 431 of file InlineAsm.h.

References assert(), B, isRegDefEarlyClobberKind(), isRegDefKind(), and isRegUseKind().


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