tqchen opened a new pull request, #18843: URL: https://github.com/apache/tvm/pull/18843
## Summary Enforce that all buffers used in BufferLoad, BufferStore, or BufferRegion must have a prior DeclBuffer or equivalent declaration (buffer_map, alloc_buffers, match_buffers, etc.) in scope. This is part of the DeclBuffer-before-use invariant from RFC#70. - Add `UndefinedBufferVerifier` to `verify_well_formed` that checks buffer-scope invariants unconditionally for all TIR (not just schedule-level) - Update `FlattenBuffer` to emit `DeclBuffer` nodes for flattened parameter buffer views at function body level - Fix `TIRVisitorWithPath` to define `SBlock::alloc_buffers` before visiting reads/writes, so allocated buffers are in scope for region references - Fix `TransformLayoutRewriter` to properly update buffer identity in access regions and match_buffer source references after layout transformation - Add `DeclBufferNode` visitor to `RenewDefMutator` so buffer data vars are properly renewed - Update ~60 test instances across 21 files: replace `T.Buffer(...)` aliases with `T.decl_buffer(...)`, add `check_well_formed=False` for expected outputs with buffer views, adjust body traversal paths for DeclBuffer nesting Supersedes #18840 (closed due to force push). ## Test plan - [x] All s_tir tests pass (1295 passed, 17 skipped) - [x] All tir-transform tests pass (336 passed, 7 xfailed, 1 xpassed) - [x] All tir-base tests pass (269 passed, 2 skipped) - [x] TVMScript roundtrip tests pass (140 passed) - [x] All-platform minimal tests pass (75 passed, 77 skipped) - [x] set_axis_separator subregion tests pass (3 passed) - [x] transform_layout tests pass (50 passed, 1 xfailed) -- 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]
