[llvm] [AArch64] Consider streaming mode in TTI interfaces for vectorization. (PR #96305)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 10:51:51 PDT 2024


================
@@ -2162,19 +2162,20 @@ AArch64TTIImpl::getRegisterBitWidth(TargetTransformInfo::RegisterKind K) const {
   case TargetTransformInfo::RGK_Scalar:
     return TypeSize::getFixed(64);
   case TargetTransformInfo::RGK_FixedWidthVector:
-    if (!ST->isNeonAvailable() && !EnableFixedwidthAutovecInStreamingMode)
-      return TypeSize::getFixed(0);
-
-    if (ST->hasSVE())
+    if (ST->useSVEForFixedLengthVectors() &&
+        (ST->isSVEAvailable() || EnableFixedwidthAutovecInStreamingMode))
       return TypeSize::getFixed(
           std::max(ST->getMinSVEVectorSizeInBits(), 128u));
----------------
paulwalker-arm wrote:

I'm not sure this is all that safe, although appreciate the StreamingSVE side of the functionality is only for testing.  I say this because the functionality is driven by `vscale_range` which is itself driven by `-msve-vector-bits`, both of whom knew nothing about SME at the point of implementation.

How do you feel about extending this PR to update clang so that `-msve-vector-bits` does not affect the `vscale_range` attribute of streaming (perhaps even streaming compatible) functions? That way streaming functions will be capped at the safe value of 128-bit.

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


More information about the llvm-commits mailing list