Skip to content

[Transform] Clone analyzer before vectorization rewriting - #3612

Merged
LeiWang1999 merged 1 commit into
tile-ai:mainfrom
sepcnt:fix-vectorize-analyzer-constness
Oct 22, 2026
Merged

LeiWang1999 merged 1 commit into
tile-ai:mainfrom
sepcnt:fix-vectorize-analyzer-constness

Conversation

@sepcnt

@sepcnt sepcnt commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

VectorizeLoop accepts a const Analyzer pointer, while VectorizeRewriter requires a mutable Analyzer to simplify loop extents. Passing the pointer directly fails C++ compilation.

Clone the analyzer before constructing the rewriter, preserving the caller's analysis context while providing a mutable copy. This follows the existing approach in GetVectorizeSize.

Related to #3226.

Summary

  • VectorizeLoop clones the supplied analyzer before constructing VectorizeRewriter.
  • The rewriter uses the mutable clone, preserving the caller’s analysis context.
  • Vectorization hint handling and the vectorize_hint == 1 path remain unchanged.

C++ style / lint notes

  • The PR changes C++ source. The touched rules in docs/developer_guide/cpp_style.md concern parameter and analyzer usage; the change does not alter a public API.
  • CI includes the “C++ API Style Audit (warning only)” step. No audit results were provided.
  • No build or test results were provided.

@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the TileLang project.

Please remember to run pre-commit run --all-files in the root directory of the project to ensure your changes are properly linted and formatted. This will help ensure your contribution passes the format check.

We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 741bf8b and ddba6f4.

📒 Files selected for processing: 1
  • src/transform/loop_vectorize.cc

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

📝 Walkthrough

VectorizeLoop now passes a cloned arithmetic analyzer to VectorizeRewriter. Vectorization hint handling and the vectorize_hint == 1 path remain unchanged.

Changes: Loop vectorization

Layer / File(s) Summary
Clone the analyzer
src/transform/loop_vectorize.cc
VectorizeLoop passes a cloned arithmetic analyzer to VectorizeRewriter instead of passing the caller’s analyzer directly.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: ljc00118

Merge Risk: ⚪ Minimal · up to ddba6

The change preserves analyzer state isolation without introducing a merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: cloning the analyzer before vectorization rewriting.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai
coderabbitai Bot requested a review from LJC00118 October 22, 2026 11:46
@LeiWang1999
LeiWang1999 merged commit fe8c346 into tile-ai:main Oct 22, 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