Skip to content

Conversation

@LeiWang1999
Copy link
Member

@LeiWang1999 LeiWang1999 commented Feb 2, 2026

Summary

  • Added a new configuration option enable_simplify_let_inline to the TileLang Simplify pass that controls whether let statements should be inlined during simplification
  • Updated PassConfigKey enum in pass_config.py with comprehensive sub-config keys for all Simplify pass options
  • Added comprehensive test coverage for the Simplify pass including tests for the new let inline configuration

Changes

C++ Changes (src/transform/simplify.cc)

  • Added enable_simplify_let_inline field to SimplifyConfigNode with default value true
  • Modified CanInlineLetStmt to check the config before allowing let statement inlining

Python Changes (tilelang/transform/pass_config.py)

  • Updated TL_SIMPLIFY documentation to accurately describe the dict-based configuration structure
  • Added individual config keys for all Simplify sub-options:
    • TL_SIMPLIFY_TRANSITIVELY_PROVE_INEQUALITIES
    • TL_SIMPLIFY_CONVERT_BOOLEAN_TO_AND_OF_ORS
    • TL_SIMPLIFY_APPLY_CONSTRAINTS_TO_BOOLEAN_BRANCHES
    • TL_SIMPLIFY_PROPAGATE_KNOWNS_TO_PROVE_CONDITIONAL
    • TL_SIMPLIFY_PROPAGATE_KNOWNS_TO_SIMPLIFY_EXPRESSIONS
    • TL_SIMPLIFY_ENABLE_LET_INLINE

Test Changes (testing/python/transform/test_tilelang_transform_simplify.py)

  • Added 32 comprehensive tests for the Simplify pass
  • Tests use PassConfigKey enum values instead of hardcoded strings
  • Includes tests for the new enable_simplify_let_inline configuration

Usage

from tilelang.transform import PassContext, PassConfigKey

# Disable let statement inlining
with PassContext(config={
    PassConfigKey.TL_SIMPLIFY.value: {
        PassConfigKey.TL_SIMPLIFY_ENABLE_LET_INLINE.value: False
    }
}):
    mod = tl.transform.Simplify()(mod)

Test plan

  • All 32 tests pass in test_tilelang_transform_simplify.py
  • Tests verify both enabled and disabled let inlining behavior

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • TL_SIMPLIFY pass now supports granular configuration options, enabling fine-grained control over simplification strategies including let statement inlining behavior.
  • Tests

    • Enhanced simplification pass test suite with improved helper utilities for configuration-based testing scenarios.

…ion Elimination

- Added a new configuration option `tilelang_enable_simplify_let_inline` to enable inlining of let statements during simplification.
- Updated the Simplify pass to conditionally inline let statements based on the new configuration.
- Integrated common subexpression elimination into the device code generation process to optimize performance.
- Enhanced test coverage for the Simplify pass, including various scenarios to validate simplification behavior.
@github-actions
Copy link

github-actions bot commented Feb 2, 2026

👋 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
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

This PR adds a configurable flag enable_simplify_let_inline to control LetStmt inlining behavior in the Simplify transformation pass. The flag is introduced to the SimplifyConfigNode configuration structure, exposed via reflection, and integrated into the pass configuration system. Tests are updated with a helper function to support configuration-driven testing of the Simplify pass.

Changes

Cohort / File(s) Summary
Simplify Configuration
src/transform/simplify.cc, tilelang/transform/pass_config.py
Added enable_simplify_let_inline boolean field to SimplifyConfigNode with default true, exposing it via reflection. Expanded TL_SIMPLIFY configuration from simple docstring to comprehensive dict-based format with six sub-keys, including the new inlining control flag.
Test Infrastructure
testing/python/transform/test_tilelang_transform_simplify.py
Added simplify_and_compare() helper function to run Simplify pass with configurable PassContext, enabling configuration-driven test scenarios. Integrated PassConfigKey imports for TL_SIMPLIFY configuration access in tests.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • tile-ai/tilelang#947: Modifies LetStmt inlining control and touches simplify/pass-config logic, directly related to this PR's configuration changes.

Suggested reviewers

  • chengyupku

Poem

🐰 A config flag hops into view,
Let statements now have choice too,
Simplify learns to bend and sway,
Tests dance through config's graceful way,
Inline or not—the flag decides the day! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main feature being added: a PassConfig option for controlling let statement inlining in the Simplify pass.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@LeiWang1999 LeiWang1999 merged commit 7bf4344 into tile-ai:main Feb 2, 2026
7 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.

1 participant