Skip to content

Commit

Permalink
Check only for "sve" target feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Anndrey24 committed May 2, 2024
1 parent ba3c477 commit eae3b4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/target/llvm/codegen_llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
Expand Down
3 changes: 1 addition & 2 deletions tests/python/codegen/test_target_codegen_aarch64.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit eae3b4c

Please sign in to comment.