diff --git a/src/target/llvm/codegen_llvm.cc b/src/target/llvm/codegen_llvm.cc index cedebd8b9eb31..e1df7ad4a073c 100644 --- a/src/target/llvm/codegen_llvm.cc +++ b/src/target/llvm/codegen_llvm.cc @@ -1130,7 +1130,7 @@ void CodeGenLLVM::SetTargetAttributes(llvm::Function* func) { } #if TVM_LLVM_VERSION >= 130 // Add vscale_range() function attribute when appropriate. - if (llvm_target_->TargetHasCPUFeature("sve") || llvm_target_->TargetHasCPUFeature("sme")) { + if (llvm_target_->TargetHasCPUFeature("sve")) { func->addFnAttr(llvm::Attribute::getWithVScaleRangeArgs( *llvm_target_->GetContext(), 1, tvm::arith::kAArch64VScaleValues.size())); } diff --git a/tests/python/codegen/test_target_codegen_aarch64.py b/tests/python/codegen/test_target_codegen_aarch64.py index 6b8bb2d9d58ba..4fc9439e08a55 100644 --- a/tests/python/codegen/test_target_codegen_aarch64.py +++ b/tests/python/codegen/test_target_codegen_aarch64.py @@ -546,8 +546,7 @@ def my_func(a: T.handle): [ ("+neon", False), ("+sve", True), - ("+v9a", True), - ("+sme", True), + ("+v9a,+sme", True), ], ) def test_vscale_range_function_attribute(mattr, expect_attr):