Anndrey24 commented on code in PR #16962: URL: https://github.com/apache/tvm/pull/16962#discussion_r1587333217
########## src/target/llvm/codegen_llvm.cc: ########## @@ -1127,6 +1128,13 @@ void CodeGenLLVM::SetTargetAttributes(llvm::Function* func) { if (!features.empty()) { func->addFnAttr("target-features", features); } +#if TVM_LLVM_VERSION >= 130 + // Add vscale_range() function attribute when appropriate. + if (llvm_target_->TargetHasCPUFeature("sve") || llvm_target_->TargetHasCPUFeature("sme")) { Review Comment: Yes, I was actually a bit unsure how to proceed with this, but it makes more sense to only check for "sve". Interestingly, just "+sme" by itself does not seem to include "sve" as part of the features returned by `GetAllLLVMCpuFeatures()`: `bf16, trbe, use-scalar-inc-vl, use-postra-scheduler, fuse-aes, fp-armv8, neon, enable-select-opt, ete, sme, fuse-adrp-add`, but "+v9a" does, so we would just need to always add them both to the target string (e.g. "mattr=+v9a,+sme"). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org