MLIR 24.0.0git
mlir::abi::ArgClassification Struct Reference

Describes how a single argument or return value is passed after ABI lowering. More...

#include "mlir/ABI/ABIRewriteContext.h"

Public Member Functions

bool isPassThrough () const
 Whether the value is passed as-is, so a rewriter can leave it alone.
bool operator== (const ArgClassification &other) const
 Whether two classifications describe the same wire format.

Static Public Member Functions

static ArgClassification getDirect ()
static ArgClassification getDirect (Type coerced, unsigned offset)
static ArgClassification getIgnore ()
static ArgClassification getIndirect (llvm::Align align, bool byVal=true)
static ArgClassification getExtend (Type coerced, bool signExt)

Public Attributes

ArgKind kind = ArgKind::Direct
Type coercedType = nullptr
 The ABI-coerced type, if different from the original.
llvm::Align indirectAlign = llvm::Align(1)
 For Indirect: alignment of the pointed-to object.
bool signExtend = false
 For Extend: whether to sign-extend (true) or zero-extend (false).
bool canFlatten = true
 For Direct: whether a struct coercion can be flattened into individual register-width arguments.
bool byVal = false
 For Indirect: whether the callee gets ownership (byval).
unsigned directOffset = 0
 For Direct with coercion: the byte offset within the original aggregate at which the coerced value lives.

Detailed Description

Describes how a single argument or return value is passed after ABI lowering.

Definition at line 60 of file ABIRewriteContext.h.

Member Function Documentation

◆ getDirect() [1/2]

ArgClassification mlir::abi::ArgClassification::getDirect ( )
inlinestatic

Definition at line 100 of file ABIRewriteContext.h.

References getDirect().

Referenced by getDirect().

◆ getDirect() [2/2]

ArgClassification mlir::abi::ArgClassification::getDirect ( Type coerced,
unsigned offset )
inlinestatic

Definition at line 104 of file ABIRewriteContext.h.

References coercedType, mlir::abi::Direct, directOffset, and kind.

◆ getExtend()

ArgClassification mlir::abi::ArgClassification::getExtend ( Type coerced,
bool signExt )
inlinestatic

Definition at line 130 of file ABIRewriteContext.h.

References coercedType, mlir::abi::Extend, kind, and signExtend.

◆ getIgnore()

ArgClassification mlir::abi::ArgClassification::getIgnore ( )
inlinestatic

Definition at line 116 of file ABIRewriteContext.h.

References mlir::abi::Ignore, and kind.

◆ getIndirect()

ArgClassification mlir::abi::ArgClassification::getIndirect ( llvm::Align align,
bool byVal = true )
inlinestatic

Definition at line 122 of file ABIRewriteContext.h.

References byVal, mlir::abi::Indirect, indirectAlign, and kind.

◆ isPassThrough()

bool mlir::abi::ArgClassification::isPassThrough ( ) const
inline

Whether the value is passed as-is, so a rewriter can leave it alone.

Only an uncoerced Direct qualifies. Extend counts as needing a rewrite even though it only adds an attribute, because the attribute changes observable behavior.

Definition at line 89 of file ABIRewriteContext.h.

References coercedType, mlir::abi::Direct, and kind.

Referenced by mlir::abi::FunctionClassification::needsRewrite().

◆ operator==()

bool mlir::abi::ArgClassification::operator== ( const ArgClassification & other) const
inline

Whether two classifications describe the same wire format.

Every field participates, so a field added above must be added here as well.

Definition at line 93 of file ABIRewriteContext.h.

References byVal, canFlatten, coercedType, directOffset, indirectAlign, kind, and signExtend.

Member Data Documentation

◆ byVal

bool mlir::abi::ArgClassification::byVal = false

For Indirect: whether the callee gets ownership (byval).

Definition at line 78 of file ABIRewriteContext.h.

Referenced by getIndirect(), and operator==().

◆ canFlatten

bool mlir::abi::ArgClassification::canFlatten = true

For Direct: whether a struct coercion can be flattened into individual register-width arguments.

Definition at line 75 of file ABIRewriteContext.h.

Referenced by operator==().

◆ coercedType

Type mlir::abi::ArgClassification::coercedType = nullptr

The ABI-coerced type, if different from the original.

Null means use the original type.

Definition at line 65 of file ABIRewriteContext.h.

Referenced by getDirect(), getExtend(), isPassThrough(), and operator==().

◆ directOffset

unsigned mlir::abi::ArgClassification::directOffset = 0

For Direct with coercion: the byte offset within the original aggregate at which the coerced value lives.

Non-zero when the low eightbyte is NO_CLASS and the value is carried in a later eightbyte (x86-64 SysV).

Definition at line 83 of file ABIRewriteContext.h.

Referenced by getDirect(), and operator==().

◆ indirectAlign

llvm::Align mlir::abi::ArgClassification::indirectAlign = llvm::Align(1)

For Indirect: alignment of the pointed-to object.

Definition at line 68 of file ABIRewriteContext.h.

Referenced by getIndirect(), and operator==().

◆ kind

ArgKind mlir::abi::ArgClassification::kind = ArgKind::Direct

◆ signExtend

bool mlir::abi::ArgClassification::signExtend = false

For Extend: whether to sign-extend (true) or zero-extend (false).

Definition at line 71 of file ABIRewriteContext.h.

Referenced by getExtend(), and operator==().


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