This is an automated email from the ASF dual-hosted git repository.

tqchen 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 e5b96be3a5 [REFACTOR][IR] Move tvm/support/with.h → 
tvm/ir/with_context.h (#19474)
e5b96be3a5 is described below

commit e5b96be3a5b07c5b6d9450eae95ab0b71f3737a1
Author: Tianqi Chen <[email protected]>
AuthorDate: Wed Apr 29 16:42:25 2026 -0400

    [REFACTOR][IR] Move tvm/support/with.h → tvm/ir/with_context.h (#19474)
    
    ## Summary
    
    `with.h`'s home in `tvm/support/` overstated its scope: every `With<T>`
    consumer is an IR/compiler context object — `PassContext`, `Target`,
    `Analyzer`, `DFPatternContext`. `tvm/support/` is for genuinely
    cross-cutting utilities (`io.h`, `parallel_for.h`, `random_engine.h`,
    `serializer.h`); `with.h` was the odd one out. The new filename
    `with_context.h` also communicates what the file actually contains — a
    RAII context-manager template — where the old `with.h` was too thin.
    
    - `git mv include/tvm/support/with.h → include/tvm/ir/with_context.h`
    - Header guard and `\file` doc updated to match new path
    - 9 consumer `#include` lines updated; class name `With<T>` unchanged
---
 include/tvm/arith/analyzer.h                      | 2 +-
 include/tvm/ir/transform.h                        | 2 +-
 include/tvm/{support/with.h => ir/with_context.h} | 8 ++++----
 include/tvm/relax/dataflow_pattern.h              | 2 +-
 include/tvm/target/target.h                       | 2 +-
 src/arith/ir_mutator_with_analyzer.h              | 2 +-
 src/arith/ir_visitor_with_analyzer.h              | 2 +-
 src/script/printer/ir/utils.h                     | 2 +-
 src/target/llvm/llvm_module.cc                    | 2 +-
 src/tirx/transform/ir_utils.h                     | 2 +-
 10 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/tvm/arith/analyzer.h b/include/tvm/arith/analyzer.h
index 76881a2cd0..d9ecc48b73 100644
--- a/include/tvm/arith/analyzer.h
+++ b/include/tvm/arith/analyzer.h
@@ -27,7 +27,7 @@
 #include <tvm/arith/int_set.h>
 #include <tvm/ffi/reflection/registry.h>
 #include <tvm/ir/expr.h>
-#include <tvm/support/with.h>
+#include <tvm/ir/with_context.h>
 
 #include <limits>
 #include <memory>
diff --git a/include/tvm/ir/transform.h b/include/tvm/ir/transform.h
index 2ef8113ff9..8a89d3d354 100644
--- a/include/tvm/ir/transform.h
+++ b/include/tvm/ir/transform.h
@@ -63,7 +63,7 @@
 #include <tvm/ir/diagnostic.h>
 #include <tvm/ir/instrument.h>
 #include <tvm/ir/module.h>
-#include <tvm/support/with.h>
+#include <tvm/ir/with_context.h>
 
 #include <string>
 #include <utility>
diff --git a/include/tvm/support/with.h b/include/tvm/ir/with_context.h
similarity index 97%
rename from include/tvm/support/with.h
rename to include/tvm/ir/with_context.h
index 8cf2823e06..1b7502f33b 100644
--- a/include/tvm/support/with.h
+++ b/include/tvm/ir/with_context.h
@@ -18,12 +18,12 @@
  */
 
 /*!
- * \file tvm/support/with.h
+ * \file tvm/ir/with_context.h
  * \brief RAII wrapper function to enter and exit a context object
  *        similar to python's with syntax.
  */
-#ifndef TVM_SUPPORT_WITH_H_
-#define TVM_SUPPORT_WITH_H_
+#ifndef TVM_IR_WITH_CONTEXT_H_
+#define TVM_IR_WITH_CONTEXT_H_
 
 #include <exception>
 #include <functional>
@@ -165,4 +165,4 @@ class WithGroup {
 };
 
 }  // namespace tvm
-#endif  // TVM_SUPPORT_WITH_H_
+#endif  // TVM_IR_WITH_CONTEXT_H_
diff --git a/include/tvm/relax/dataflow_pattern.h 
b/include/tvm/relax/dataflow_pattern.h
index 492b53bf59..f295eeeb29 100644
--- a/include/tvm/relax/dataflow_pattern.h
+++ b/include/tvm/relax/dataflow_pattern.h
@@ -28,9 +28,9 @@
 #include <tvm/ffi/optional.h>
 #include <tvm/ffi/reflection/registry.h>
 #include <tvm/ir/expr.h>
+#include <tvm/ir/with_context.h>
 #include <tvm/relax/expr.h>
 #include <tvm/relax/type.h>
-#include <tvm/support/with.h>
 
 #include <cstdint>
 #include <functional>
diff --git a/include/tvm/target/target.h b/include/tvm/target/target.h
index a9f6f6e848..5be8f07dce 100644
--- a/include/tvm/target/target.h
+++ b/include/tvm/target/target.h
@@ -28,8 +28,8 @@
 #include <tvm/ir/cast.h>
 #include <tvm/ir/expr.h>
 #include <tvm/ir/function.h>
+#include <tvm/ir/with_context.h>
 #include <tvm/runtime/device_api.h>
-#include <tvm/support/with.h>
 #include <tvm/target/target_kind.h>
 
 #include <string>
diff --git a/src/arith/ir_mutator_with_analyzer.h 
b/src/arith/ir_mutator_with_analyzer.h
index 178b2a6d34..a1f6ad4946 100644
--- a/src/arith/ir_mutator_with_analyzer.h
+++ b/src/arith/ir_mutator_with_analyzer.h
@@ -26,7 +26,7 @@
 
 #include <tvm/arith/analyzer.h>
 #include <tvm/ir/scope_stack.h>
-#include <tvm/support/with.h>
+#include <tvm/ir/with_context.h>
 #include <tvm/tirx/analysis.h>
 #include <tvm/tirx/stmt_functor.h>
 
diff --git a/src/arith/ir_visitor_with_analyzer.h 
b/src/arith/ir_visitor_with_analyzer.h
index 404a14cf20..24728c69e1 100644
--- a/src/arith/ir_visitor_with_analyzer.h
+++ b/src/arith/ir_visitor_with_analyzer.h
@@ -27,7 +27,7 @@
 
 #include <tvm/arith/analyzer.h>
 #include <tvm/ir/scope_stack.h>
-#include <tvm/support/with.h>
+#include <tvm/ir/with_context.h>
 #include <tvm/tirx/expr.h>
 #include <tvm/tirx/stmt_functor.h>
 
diff --git a/src/script/printer/ir/utils.h b/src/script/printer/ir/utils.h
index 6afc52cab7..627cb37828 100644
--- a/src/script/printer/ir/utils.h
+++ b/src/script/printer/ir/utils.h
@@ -23,8 +23,8 @@
 #include <tvm/ir/expr.h>
 #include <tvm/ir/function.h>
 #include <tvm/ir/op.h>
+#include <tvm/ir/with_context.h>
 #include <tvm/script/printer/ir_docsifier.h>
-#include <tvm/support/with.h>
 
 #include <string>
 #include <utility>
diff --git a/src/target/llvm/llvm_module.cc b/src/target/llvm/llvm_module.cc
index 1f6a4e743b..cae8cabaca 100644
--- a/src/target/llvm/llvm_module.cc
+++ b/src/target/llvm/llvm_module.cc
@@ -61,9 +61,9 @@
 #include <tvm/ffi/function.h>
 #include <tvm/ffi/string.h>
 #include <tvm/ir/module.h>
+#include <tvm/ir/with_context.h>
 #include <tvm/runtime/logging.h>
 #include <tvm/runtime/object.h>
-#include <tvm/support/with.h>
 #include <tvm/target/codegen.h>
 #include <tvm/target/target.h>
 
diff --git a/src/tirx/transform/ir_utils.h b/src/tirx/transform/ir_utils.h
index dad1d92eaf..f77d73fbcf 100644
--- a/src/tirx/transform/ir_utils.h
+++ b/src/tirx/transform/ir_utils.h
@@ -27,9 +27,9 @@
 #include <tvm/arith/int_set.h>
 #include <tvm/arith/int_solver.h>
 #include <tvm/ffi/container/tuple.h>
+#include <tvm/ir/with_context.h>
 #include <tvm/runtime/device_api.h>
 #include <tvm/s_tir/stmt.h>
-#include <tvm/support/with.h>
 #include <tvm/tirx/builtin.h>
 #include <tvm/tirx/expr.h>
 #include <tvm/tirx/function.h>

Reply via email to