[llvm] [AArch64][SME] Allow memory operations lowering to custom SME functions. (PR #79263)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 00:24:25 PST 2024


================
@@ -7659,8 +7659,14 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
   SMEAttrs CalleeAttrs, CallerAttrs(MF.getFunction());
   if (CLI.CB)
     CalleeAttrs = SMEAttrs(*CLI.CB);
-  else if (auto *ES = dyn_cast<ExternalSymbolSDNode>(CLI.Callee))
-    CalleeAttrs = SMEAttrs(ES->getSymbol());
+  else if (auto *ES = dyn_cast<ExternalSymbolSDNode>(CLI.Callee)) {
+    if (StringRef(ES->getSymbol()) == StringRef("__arm_sc_memcpy")) {
+      auto Attrs = AttributeList().addFnAttribute(
+          *DAG.getContext(), "aarch64_pstate_sm_compatible");
+      CalleeAttrs = SMEAttrs(Attrs);
----------------
sdesmalen-arm wrote:

Is this change actually needed when you also make this change in `SMEAttrs::SMEAttrs(StringRef FuncName)`?

https://github.com/llvm/llvm-project/pull/79263


More information about the llvm-commits mailing list