18void SMEAttrs::validate()
const {
21 "SM_Enabled and SM_Compatible are mutually exclusive");
25 "ZA_New and SME_ABI_Routine are mutually exclusive");
29 "Attributes 'aarch64_new_za', 'aarch64_in_za', 'aarch64_out_za', "
30 "'aarch64_inout_za' and 'aarch64_preserves_za' are mutually exclusive");
36 "Attributes 'aarch64_new_zt0', 'aarch64_in_zt0', 'aarch64_out_zt0', "
37 "'aarch64_inout_zt0' and 'aarch64_preserves_zt0' are mutually exclusive");
40 "Function cannot have a shared-ZA interface and an agnostic-ZA "
49 for (
Attribute Attr : Attrs.getFnAttrs()) {
50 if (!Attr.isStringAttribute())
54 if (!Kind.consume_front(
"aarch64_"))
76void SMEAttrs::addKnownFunctionAttrs(
StringRef FuncName,
79 if (Impl == RTLIB::Unsupported)
84 case RTLIB::SMEABI_SME_STATE:
85 case RTLIB::SMEABI_TPIDR2_SAVE:
86 case RTLIB::SMEABI_GET_CURRENT_VG:
87 case RTLIB::SMEABI_SME_STATE_SIZE:
88 case RTLIB::SMEABI_SME_SAVE:
89 case RTLIB::SMEABI_SME_RESTORE:
92 case RTLIB::SMEABI_ZA_DISABLE:
93 case RTLIB::SMEABI_TPIDR2_RESTORE:
97 case RTLIB::SC_MEMCPY:
98 case RTLIB::SC_MEMMOVE:
99 case RTLIB::SC_MEMSET:
100 case RTLIB::SC_MEMCHR:
110 if (
callee().hasStreamingCompatibleInterface())
114 if (
caller().hasNonStreamingInterfaceAndBody() &&
115 callee().hasNonStreamingInterface())
119 if (
caller().hasStreamingInterfaceOrBody() &&
120 callee().hasStreamingInterface())
131 CalledFn =
SMEAttrs(*CalledFunction, RTLCI);
135 assert((IsIndirect || ((Callsite | CalledFn) == CalledFn)) &&
136 "SME attributes at callsite do not match declaration");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static Function * getFunction(FunctionType *Ty, const Twine &Name, Module *M)
Functions, function parameters, and return types can have attributes to indicate how they should be t...
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
SMEAttrs is a utility class to parse the SME ACLE attributes on functions.
bool isPreservesZT0() const
bool hasStreamingInterface() const
static unsigned encodeZAState(StateValue S)
bool hasStreamingCompatibleInterface() const
bool hasAgnosticZAInterface() const
bool isPreservesZA() const
void set(unsigned M, bool Enable=true)
bool hasSharedZAInterface() const
static unsigned encodeZT0State(StateValue S)
bool requiresSMChange() const
SMECallAttrs(SMEAttrs Caller, SMEAttrs Callee, SMEAttrs Callsite=SMEAttrs::Normal)
Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
This is an optimization pass for GlobalISel generic memory operations.
static bool isIndirectCall(const MachineInstr &MI)
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
A simple container for information about the supported runtime calls.
RTLIB::LibcallImpl getSupportedLibcallImpl(StringRef FuncName) const
Check if this is valid libcall for the current module, otherwise RTLIB::Unsupported.
static RTLIB::Libcall getLibcallFromImpl(RTLIB::LibcallImpl Impl)
Return the libcall provided by Impl.