[llvm] [AArch64][SME] Conditionally do smstart/smstop (PR #77113)

Matthew Devereau via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 05:53:47 PST 2024


================
@@ -65,6 +65,16 @@ SMEAttrs::SMEAttrs(const AttributeList &Attrs) {
 std::optional<bool>
 SMEAttrs::requiresSMChange(const SMEAttrs &Callee,
                            bool BodyOverridesInterface) const {
+  // If the caller has a streaming body and streaming compatible interface,
+  // we will have already conditionally enabled streaming mode on function
+  // entry. We need to disable streaming mode when a callee does not have A
+  // streaming interface, body, or streaming compatible interface.
+  if (hasStreamingBody() && hasStreamingCompatibleInterface())
+    return (!Callee.hasStreamingInterfaceOrBody() &&
+            !Callee.hasStreamingCompatibleInterface())
+               ? std::optional<bool>(false)
+               : std::nullopt;
+
----------------
MDevereau wrote:

I think this had an interaction with the some of earlier tests that were removed and certain caller/callee combinations weren't correctly return as needing a streaming-mode change, or things we're incorrectly falling through to `getPStateSM` which has now been changed. This whole function is quite weird in general, I don't really understand the advantage a 3rd state provided by the std::optional class brings. Either it needs a streaming mode change or it doesn't. Either way this snippet just be removed for now

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


More information about the llvm-commits mailing list