cbalint13 commented on code in PR #18586:
URL: https://github.com/apache/tvm/pull/18586#discussion_r2620391361


##########
src/target/llvm/codegen_aarch64.cc:
##########
@@ -59,9 +59,11 @@ void CodeGenAArch64::SetTargetAttributes(llvm::Function* 
func) {
   // Add vscale_range() function attribute when appropriate.
   if (llvm_target_->TargetHasCPUFeature("sve") || 
llvm_target_->TargetHasCPUFeature("sme")) {
     auto kVScaleValues = arith::GetVScaleValues(Target::Current());
-    unsigned int max_val = *std::max_element(kVScaleValues.begin(), 
kVScaleValues.end());
-    func->addFnAttr(
-        llvm::Attribute::getWithVScaleRangeArgs(*llvm_target_->GetContext(), 
1, max_val));
+    if (!kVScaleValues.empty()) {

Review Comment:
   > Thank you for your comment @cbalint13 !
   > I'm targetting Apple M4 Pro. Seems like`vector_width` is 128.
   > Here's repro.
   
   @mshr-h 
   
   Thanks a lot for the help !
   
   * I look at this, definitely would like to make it work properly !
   * I have a OPI6 (SVE+SME support) , would like to see the tensorized kernels 
(expecting TFLOPS level).
   * And it is time to fix tensorization for the transposed flavours of GEMM 
too.
   
   I can do only in weekend, this week I am very busy.
   
   ------
   
   In meanwhile if wish you can merge it **as-is**, I can fix in subsecvent PR 
(will let you know Cc ).
   Once again thanks for looking into this !
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to