16#include "TargetInfo.h"
25class AArch64ABIInfo :
public ABIInfo {
27 AArch64ABIInfo(CIRGenTypes &cgt) : ABIInfo(cgt) {}
32 AArch64TargetCIRGenInfo(CIRGenTypes &cgt)
33 : TargetCIRGenInfo(std::make_unique<AArch64ABIInfo>(cgt)) {}
35 void setTargetAttributes(
const Decl *d, mlir::Operation *gv,
36 CIRGenModule &cgm)
const override {
37 auto fn = mlir::dyn_cast<cir::FuncOp>(gv);
44 bool isScalarizableAsmOperand(CIRGenFunction &cgf,
45 mlir::Type ty)
const override {
47 cgf.
cgm.
errorNYI(
"AArch64 LS64 scalarizable asm operand");
53 bool wouldInliningViolateFunctionCallABI(
54 const FunctionDecl *caller,
const FunctionDecl *callee)
const override;
75 return fpt->getAArch64SMEAttributes() &
84 bool callerIsStreaming =
86 bool calleeIsStreaming =
93 if (!calleeIsStreamingCompatible &&
94 (callerIsStreaming != calleeIsStreaming || callerIsStreamingCompatible)) {
95 if (calleeIsStreaming)
100 if (
auto *newAttr = callee->
getAttr<ArmNewAttr>()) {
101 if (newAttr->isNewZA())
103 if (newAttr->isNewZT0())
110bool AArch64TargetCIRGenInfo::wouldInliningViolateFunctionCallABI(
112 return caller && callee &&
116std::unique_ptr<TargetCIRGenInfo>
118 return std::make_unique<AArch64TargetCIRGenInfo>(cgt);
static ArmSMEInlinability getArmSMEInlinability(const FunctionDecl *caller, const FunctionDecl *callee)
Determines if there are any Arm SME ABI issues with inlining Callee into Caller.
@ ErrorCalleeRequiresNewZA
@ WarnIncompatibleStreamingModes
@ ErrorCalleeRequiresNewZT0
@ IncompatibleStreamingModes
@ LLVM_MARK_AS_BITMASK_ENUM
@ ErrorIncompatibleStreamingModes
static bool isStreamingCompatible(const FunctionDecl *fd)
const TargetInfo & getTarget() const
DiagnosticBuilder errorNYI(SourceLocation, llvm::StringRef)
Helpers to emit "not yet implemented" error diagnostics.
This class organizes the cross-module state that is used while lowering AST types to CIR types.
virtual bool isScalarizableAsmOperand(CIRGenFunction &cgf, mlir::Type ty) const
Represents a function declaration or definition.
Represents a prototype with parameter type info, e.g.
@ SME_PStateSMCompatibleMask
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
const T * getAs() const
Member-template getAs<specific type>'.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
std::unique_ptr< TargetCIRGenInfo > createAArch64TargetCIRGenInfo(CIRGenTypes &cgt)
Top level wrappers for InstallAPI frontend operations.
bool IsArmStreamingFunction(const FunctionDecl *FD, bool IncludeLocallyStreaming)
Returns whether the given FunctionDecl has an __arm[_locally]_streaming attribute.
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 uint8_t
static bool branchProtection()
static bool pointerAuthentication()