jroesch commented on a change in pull request #7829:
URL: https://github.com/apache/tvm/pull/7829#discussion_r612041999



##########
File path: src/tir/ir/script/script_complete.cc
##########
@@ -76,8 +76,15 @@ class ScriptCompleter : public StmtMutator {
     for (const auto& alloc_buffer : op->alloc_buffers) {
       buffer_var_map_->erase(alloc_buffer->data);
     }
+    // Get access detection mask
+    // 0 for provided region, 1 and 3 for need detect read, 2 and 3 for need 
detect write
+    int mask = 0;
+    auto it = op->annotations.find(attr::script_parsing_detect_access);
+    if (it != op->annotations.end()) {
+      mask = Downcast<IntImm>((*it).second)->value;
+    }
     // ignore root block or blocks which already has reads/writes regions
-    if (block->reads.empty() || block->writes.empty()) {
+    if (mask != 0) {

Review comment:
       Is there a reason we moved away from high level checks like this? the 
masking logic is way less clear from my PoV.




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to