[llvm] [AArch64] Consider runtime mode when deciding to use SVE for fixed-length vectors. (PR #96081)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 01:42:49 PDT 2024


================
@@ -1,9 +1,8 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc -mattr=+sve -force-streaming-compatible  < %s | FileCheck %s --check-prefixes=CHECK,SVE
 ; RUN: llc -mattr=+sve2 -force-streaming-compatible  < %s | FileCheck %s --check-prefixes=CHECK,SVE2
-; RUN: llc -mattr=+sme -force-streaming-compatible  < %s | FileCheck %s --check-prefixes=CHECK,SVE2
-; FIXME: We shouldn't ever be emitting any SVE instructions when +sme is set but the function is not in streaming mode.
-; RUN: llc -mattr=+sme < %s | FileCheck %s --check-prefixes=NEON-NOSVE
+; RUN: llc -mattr=+sme -force-streaming  < %s | FileCheck %s --check-prefixes=CHECK,SVE2
+; RUN: llc -mattr=+sme -force-streaming-compatible < %s | FileCheck %s --check-prefixes=NONEON-NOSVE
----------------
sdesmalen-arm wrote:

Well that was actually the point of adding this RUN line.

As you can see in the diff before this patch, before this patch:
* when compiling with `llc -force-streaming-compatible` this resulted in scalar-only code (as expected)
* but when compiling with `llc -force-streaming-compatible -mattr=+sme` this resulted in an SVE `div` instruction (wrong)
This case would not be covered with `llc -mattr=+sme -force-streaming`, because that case can use all SVE instructions.

That said, I'm not sure if this RUN line is now protecting against a condition that was written wrongly in the first place, and is therefore not a case worth protecting. But I figured it wouldn't hurt to keep the RUN line.

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


More information about the llvm-commits mailing list