lhutton1 commented on code in PR #16893:
URL: https://github.com/apache/tvm/pull/16893#discussion_r1572037658
##########
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:
I did something similar here:
https://github.com/apache/tvm/blob/d4056ca79571d4265a12beeedd1b1565953df936/src/arith/analyzer.cc#L241,
but your approach is much neater :). Perhaps we could create a utility
function to keep them consistent since this will likely pop up elsewhere in the
future?
--
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]