[clang] [AArch64] Enable vscale_range with +sme (PR #124466)

David Green via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 29 03:45:13 PST 2025


================
@@ -708,7 +708,7 @@ AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts) const {
     return std::pair<unsigned, unsigned>(
         LangOpts.VScaleMin ? LangOpts.VScaleMin : 1, LangOpts.VScaleMax);
 
-  if (hasFeature("sve"))
+  if (hasFeature("sve") || hasFeature("sme"))
----------------
davemgreen wrote:

> If the function only has +sme, then vscale_range should only apply to (locally) streaming functions, because non-streaming or streaming-compatible functions cannot use scalable vectors.

vscale_range should be valid on any function, and will only be used if there are scalable vectors present. I've had a go at making it only apply to streaming functions, but it couldn't pass FunctionDecl to getVScaleRange as that would create a layering violation. I'm not sure I prefer this to the original that just applied it to all functions, unless you have a better suggestion?

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


More information about the cfe-commits mailing list