|
MLIR 24.0.0git
|
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, llvm::MaybeAlign align=std::nullopt) |
| static ArgClassification | getIgnore () |
| static ArgClassification | getIndirect (llvm::Align align, bool byVal, unsigned addrSpace) |
| static ArgClassification | getIndirectAliased (llvm::Align align, unsigned addrSpace) |
| 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 and IndirectAliased: 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 | indirectAddrSpace = 0 |
| For Indirect and IndirectAliased: target address space of the pointer passed in place of the value. | |
| unsigned | directOffset = 0 |
| For Direct with coercion: the byte offset within the original aggregate at which the coerced value lives. | |
| llvm::MaybeAlign | directAlign |
| For Direct: the alignment of the argument's stack slot when the value is passed in memory, if the ABI sets one apart from the type's. | |
| unsigned | neededIntRegs = 0 |
| How many integer and vector argument registers the value occupies. | |
| unsigned | neededSseRegs = 0 |
Describes how a single argument or return value is passed after ABI lowering.
Definition at line 64 of file ABIRewriteContext.h.
|
inlinestatic |
Definition at line 127 of file ABIRewriteContext.h.
References getDirect().
Referenced by getDirect().
|
inlinestatic |
Definition at line 131 of file ABIRewriteContext.h.
References coercedType, mlir::abi::Direct, directAlign, directOffset, and kind.
|
inlinestatic |
Definition at line 170 of file ABIRewriteContext.h.
References coercedType, mlir::abi::Extend, kind, and signExtend.
|
inlinestatic |
Definition at line 145 of file ABIRewriteContext.h.
References mlir::abi::Ignore, and kind.
|
inlinestatic |
Definition at line 151 of file ABIRewriteContext.h.
References byVal, mlir::abi::Indirect, indirectAddrSpace, indirectAlign, and kind.
|
inlinestatic |
Definition at line 161 of file ABIRewriteContext.h.
References indirectAddrSpace, mlir::abi::IndirectAliased, indirectAlign, and kind.
|
inline |
Whether the value is passed as-is, so a rewriter can leave it alone.
Only an uncoerced Direct with no stack-slot alignment qualifies. Extend counts as needing a rewrite even though it only adds an attribute, because the attribute changes observable behavior, and a Direct with a stack-slot alignment does too because it needs llvm.alignstack.
Definition at line 109 of file ABIRewriteContext.h.
References coercedType, mlir::abi::Direct, directAlign, and kind.
Referenced by mlir::abi::FunctionClassification::needsRewrite().
|
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 115 of file ABIRewriteContext.h.
References byVal, canFlatten, coercedType, directAlign, directOffset, indirectAddrSpace, indirectAlign, kind, neededIntRegs, neededSseRegs, and signExtend.
For Indirect: whether the callee gets ownership (byval).
Definition at line 82 of file ABIRewriteContext.h.
Referenced by getIndirect(), and operator==().
For Direct: whether a struct coercion can be flattened into individual register-width arguments.
Definition at line 79 of file ABIRewriteContext.h.
Referenced by operator==().
The ABI-coerced type, if different from the original.
Null means use the original type.
Definition at line 69 of file ABIRewriteContext.h.
Referenced by getDirect(), getExtend(), isPassThrough(), and operator==().
| llvm::MaybeAlign mlir::abi::ArgClassification::directAlign |
For Direct: the alignment of the argument's stack slot when the value is passed in memory, if the ABI sets one apart from the type's.
Definition at line 95 of file ABIRewriteContext.h.
Referenced by getDirect(), isPassThrough(), and operator==().
| 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 91 of file ABIRewriteContext.h.
Referenced by getDirect(), and operator==().
| unsigned mlir::abi::ArgClassification::indirectAddrSpace = 0 |
For Indirect and IndirectAliased: target address space of the pointer passed in place of the value.
Zero is the default address space.
Definition at line 86 of file ABIRewriteContext.h.
Referenced by getIndirect(), getIndirectAliased(), and operator==().
| llvm::Align mlir::abi::ArgClassification::indirectAlign = llvm::Align(1) |
For Indirect and IndirectAliased: alignment of the pointed-to object.
Definition at line 72 of file ABIRewriteContext.h.
Referenced by getIndirect(), getIndirectAliased(), and operator==().
| ArgKind mlir::abi::ArgClassification::kind = ArgKind::Direct |
Definition at line 65 of file ABIRewriteContext.h.
Referenced by getDirect(), getExtend(), getIgnore(), getIndirect(), getIndirectAliased(), isPassThrough(), and operator==().
| unsigned mlir::abi::ArgClassification::neededIntRegs = 0 |
How many integer and vector argument registers the value occupies.
Both zero means it travels in memory, which is also what a target whose classifier does not record the demand reports.
Definition at line 100 of file ABIRewriteContext.h.
Referenced by operator==().
| unsigned mlir::abi::ArgClassification::neededSseRegs = 0 |
Definition at line 101 of file ABIRewriteContext.h.
Referenced by operator==().
For Extend: whether to sign-extend (true) or zero-extend (false).
Definition at line 75 of file ABIRewriteContext.h.
Referenced by getExtend(), and operator==().