tqchen opened a new pull request, #19636:
URL: https://github.com/apache/tvm/pull/19636

   ## Background
   
   `class Integer : public IntImm` and `class Bool : public IntImm` were thin
   wrappers sharing `IntImmNode` with no separate node class and no FFI
   registration.  They existed to provide implicit int→Integer constructors and
   a `.IntValue()` / `operator bool()` accessor, but the same functionality is
   available directly through `IntImm`.
   
   ## What this PR does
   
   Migrates all call sites away from `Integer` / `Bool` and then deletes the
   class definitions.  The changes are split into four commits, each
   independently buildable:
   
   **Commit 1 – [REFACTOR][TIR]** Replace IR-position `Integer(N)` / `Bool(b)`
   constructors with `IntImm(DataType::Int(32), N)` / `IntImm(DataType::Bool(), 
b)`
   across ~62 source files (arith, relax analysis, s_tir schedule state, 
transform
   passes, codegen).
   
   **Commit 2 – [REFACTOR][SCHEDULE]** Migrate `Schedule` and `MetaSchedule`
   trace-boxing code: `Integer(N)` attrs in `TracedSchedule` → 
`IntImm(DataType::Int(32), N)`;
   `ffi::Array<Integer>` schedule-rule parameters → `int64_t`; `Bool(b)` attrs →
   `IntImm(DataType::Bool(), b)`.
   
   **Commit 3 – [REFACTOR][TOPI]** Migrate topi container signatures
   (`ffi::Array<Integer>` → `ffi::Array<int64_t>`) and update all internal
   usages (`.IntValue()` → plain int64_t, `.defined()` → removed,
   `->value` → direct indexing).  Also handles stray `Integer` / `Bool`
   variables in clml codegen, make_packed_api, infer_layout_utils, and
   relax distributed code.
   
   **Commit 4 – [REFACTOR][IR]** Delete `class Bool`, `class Integer`,
   `TypeTraits<Bool>`, and `TypeTraits<Integer>` from `include/tvm/ir/expr.h`.
   
   ## Canonical replacements
   
   | Old | New |
   |-----|-----|
   | `Integer(N)` | `IntImm(DataType::Int(32), N)` |
   | `Bool(b)` | `IntImm(DataType::Bool(), b)` |
   | `x.IntValue()` | `x->value` |
   | `x` as bool | `x->value != 0` |
   | `ffi::Array<Integer>` | `ffi::Array<int64_t>` |
   
   ## Testing
   
   - All 118 C++ unit tests pass (`./cpptest`)
   - `tests/python/s_tir/` — 1251 passed (14 pre-existing failures unrelated to 
this change, all in TIR transform tests with annotation-mismatch errors)
   - `tests/python/relax/` — passes (excluding pre-existing torch/torchvision 
import failures in frontend tests)


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to