Skip to content

[REFACTOR][S-TIR] Minimize src/support/ by relocating s_tir-private headers#19460

Merged
tqchen merged 2 commits into
apache:mainfrom
tqchen:support-helper-minimization
Apr 27, 2026
Merged

[REFACTOR][S-TIR] Minimize src/support/ by relocating s_tir-private headers#19460
tqchen merged 2 commits into
apache:mainfrom
tqchen:support-helper-minimization

Conversation

@tqchen

@tqchen tqchen commented Apr 27, 2026

Copy link
Copy Markdown
Member

Relocates s_tir-private headers from src/support/ into src/s_tir/support/, minimizing public API surface. Changes include:

  • Move table_printer, array→array_utils, nd_int_set, parallel_for into src/s_tir/support/
  • Delete hexdump, merge generic_arena→arena, extract limits.h from scalars.h
  • Rewrite AsList use sites in relax to vectors

Test plan:

  • cpptest: 2/2 passed
  • s_tir (base + schedule): 653 passed
  • meta_schedule: 182 passed
  • relax/te: 230+ passed
  • tirx-base: 273 passed
  • Build: clean
  • pre-commit: clean

…eaders

This PR consolidates src/support/ by moving s_tir-private helpers into
a new src/s_tir/support/ directory, merging generic_arena.h into arena.h,
extracting fp-limits constants into limits.h, and deleting unused code.

Main changes:

- Move table_printer.h, array.h (→ array_utils.h), nd_int_set.h, and
  parallel_for.h (made header-only) to src/s_tir/support/
- Merge generic_arena.h content into arena.h; delete generic_arena.h
- Extract kMax* fp-limit constants from scalars.h into new limits.h;
  delete scalars.{h,cc} (unused functions) and hexdump.h
- Rewrite layout_transformation.cc to use std::vector instead of std::list,
  removing the support::AsList/AsArray dependency

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the support directory by moving several utilities, including parallel_for, array_utils, and nd_int_set, to src/s_tir/support/ and merging generic_arena.h into arena.h. It also removes scalars.h, scalars.cc, and hexdump.h, while introducing limits.h for numeric range constants. Review feedback identifies a typo in a static assertion message and highlights the need to relocate deleted unit tests for parallel_for to ensure continued test coverage.

Comment thread src/support/arena.h Outdated
Comment thread tests/cpp/parallel_for_test.cc
The merge of generic_arena.h into arena.h carried a typo in the
alignment check error message. Correct "To large" to "Too large".
@tqchen

tqchen commented Apr 27, 2026

Copy link
Copy Markdown
Member Author

Fixed the typo in the error message! Changed 'To large alignment' to 'Too large alignment' in commit 35fbe1f on this branch.

@tqchen tqchen merged commit 70cfd99 into apache:main Apr 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants