================ @@ -794,14 +795,22 @@ AArch64TargetInfo::getTargetBuiltins() const { std::optional<std::pair<unsigned, unsigned>> AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts, - bool IsArmStreamingFunction) const { + bool IsArmStreamingFunction, + llvm::Function *F) const { if (LangOpts.VScaleMin || LangOpts.VScaleMax) return std::pair<unsigned, unsigned>( LangOpts.VScaleMin ? LangOpts.VScaleMin : 1, LangOpts.VScaleMax); if (hasFeature("sve") || (IsArmStreamingFunction && hasFeature("sme"))) return std::pair<unsigned, unsigned>(1, 16); + if (F && F->hasFnAttribute("target-features")) { + StringRef Str = F->getFnAttribute("target-features").getValueAsString(); + for (const auto &s : llvm::split(Str, ",")) { + if (s == "+sve") ---------------- MDevereau wrote:
I agree it makes sense, but the reason I hesitated was IsArmStreamingFunction looks like it could become an internal function of FunctionDecl which should help keep CodeGenFunction.cpp target agnostic. I thought it might be better to submit the changes to SME streaming mode as a separate patch. https://github.com/llvm/llvm-project/pull/137624 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits