This is an automated email from the ASF dual-hosted git repository.
syfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 08f3365cac Fix zero-extent loops in PerStoreFeature to prevent crashes
(#17995)
08f3365cac is described below
commit 08f3365cacfaee9dcab2b630b35387856c0b8209
Author: Qingchao Shen <[email protected]>
AuthorDate: Wed May 21 13:38:02 2025 +0800
Fix zero-extent loops in PerStoreFeature to prevent crashes (#17995)
Update per_store_feature.cc
---
src/meta_schedule/feature_extractor/per_store_feature.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/meta_schedule/feature_extractor/per_store_feature.cc
b/src/meta_schedule/feature_extractor/per_store_feature.cc
index 955e39df4f..5d91bc34f9 100644
--- a/src/meta_schedule/feature_extractor/per_store_feature.cc
+++ b/src/meta_schedule/feature_extractor/per_store_feature.cc
@@ -279,6 +279,9 @@ Pass SimplifyForFeatureExtraction() {
}
Stmt VisitStmt_(const ForNode* loop) final {
+ if (is_zero(loop->extent)) {
+ return Evaluate(0);
+ }
if (is_zero(loop->min) && is_one(loop->extent) && loop->kind ==
ForKind::kSerial &&
loop->annotations.empty()) {
unit_vars_.insert(loop->loop_var);