17void SMEAttrs::validate()
const {
20 "SM_Enabled and SM_Compatible are mutually exclusive");
24 "ZA_New and SME_ABI_Routine are mutually exclusive");
28 "Attributes 'aarch64_new_za', 'aarch64_in_za', 'aarch64_out_za', "
29 "'aarch64_inout_za' and 'aarch64_preserves_za' are mutually exclusive");
35 "Attributes 'aarch64_new_zt0', 'aarch64_in_zt0', 'aarch64_out_zt0', "
36 "'aarch64_inout_zt0' and 'aarch64_preserves_zt0' are mutually exclusive");
39 "Function cannot have a shared-ZA interface and an agnostic-ZA "
45 if (Attrs.hasFnAttr(
"aarch64_pstate_sm_enabled"))
47 if (Attrs.hasFnAttr(
"aarch64_pstate_sm_compatible"))
49 if (Attrs.hasFnAttr(
"aarch64_pstate_sm_body"))
51 if (Attrs.hasFnAttr(
"aarch64_za_state_agnostic"))
53 if (Attrs.hasFnAttr(
"aarch64_zt0_undef"))
55 if (Attrs.hasFnAttr(
"aarch64_in_za"))
57 if (Attrs.hasFnAttr(
"aarch64_out_za"))
59 if (Attrs.hasFnAttr(
"aarch64_inout_za"))
61 if (Attrs.hasFnAttr(
"aarch64_preserves_za"))
63 if (Attrs.hasFnAttr(
"aarch64_new_za"))
65 if (Attrs.hasFnAttr(
"aarch64_in_zt0"))
67 if (Attrs.hasFnAttr(
"aarch64_out_zt0"))
69 if (Attrs.hasFnAttr(
"aarch64_inout_zt0"))
71 if (Attrs.hasFnAttr(
"aarch64_preserves_zt0"))
73 if (Attrs.hasFnAttr(
"aarch64_new_zt0"))
77void SMEAttrs::addKnownFunctionAttrs(
StringRef FuncName,
80 if (Impl == RTLIB::Unsupported)
85 case RTLIB::SMEABI_SME_STATE:
86 case RTLIB::SMEABI_TPIDR2_SAVE:
87 case RTLIB::SMEABI_GET_CURRENT_VG:
88 case RTLIB::SMEABI_SME_STATE_SIZE:
89 case RTLIB::SMEABI_SME_SAVE:
90 case RTLIB::SMEABI_SME_RESTORE:
93 case RTLIB::SMEABI_ZA_DISABLE:
94 case RTLIB::SMEABI_TPIDR2_RESTORE:
98 case RTLIB::SC_MEMCPY:
99 case RTLIB::SC_MEMMOVE:
100 case RTLIB::SC_MEMSET:
101 case RTLIB::SC_MEMCHR:
111 if (
callee().hasStreamingCompatibleInterface())
115 if (
caller().hasNonStreamingInterfaceAndBody() &&
116 callee().hasNonStreamingInterface())
120 if (
caller().hasStreamingInterfaceOrBody() &&
121 callee().hasStreamingInterface())
131 CalledFn =
SMEAttrs(*CalledFunction, TLI);
137 "SME attributes at callsite do not match declaration");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static Function * getFunction(FunctionType *Ty, const Twine &Name, Module *M)
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
SMEAttrs withoutPerCallsiteFlags() 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)
StringRef - Represent a constant reference to a string, i.e.
RTLIB::LibcallImpl getSupportedLibcallImpl(StringRef FuncName) const
Check if this is valid libcall for the current module, otherwise RTLIB::Unsupported.
This is an optimization pass for GlobalISel generic memory operations.
static bool isIndirectCall(const MachineInstr &MI)
static RTLIB::Libcall getLibcallFromImpl(RTLIB::LibcallImpl Impl)
Return the libcall provided by Impl.