ekalda commented on code in PR #16893: URL: https://github.com/apache/tvm/pull/16893#discussion_r1572113539
########## src/tir/transforms/vectorize_loop.cc: ########## @@ -727,6 +730,17 @@ class LoopVectorizer : public StmtMutator { public: Stmt VisitStmt_(const ForNode* op) final { if (op->kind == ForKind::kVectorized) { + auto* extent_as_int = op->extent.as<IntImmNode>(); + if (!extent_as_int || extent_as_int->value < 1) { + Target current_target = Target::Current(); + bool has_sve{false}; + if (current_target.defined()) { + has_sve = current_target->GetFeature<Bool>("has_sve").value_or(Bool(false)); Review Comment: Good idea, I'll create a utility for it, it probably won't be the last time we would need to do that check :) There is another new utility function in @Anndrey24's [patch that is in progress ](https://github.com/apache/tvm/pull/16899/files#diff-a31e6da5360b6615078023bb62667d79ff77fad68c29dda820a9267a918d9c01L44) for checking whether an expression contains `vscale`, so once this goes in, we should unify the uses for that case as well. -- 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