[BugFix] LoopUnswitching: gate non-trivial else behind PassConfig#1816
[BugFix] LoopUnswitching: gate non-trivial else behind PassConfig#1816LeiWang1999 wants to merge 1 commit intotile-ai:mainfrom
Conversation
|
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀 |
📝 WalkthroughWalkthroughThis PR enhances the loop unswitching pass with configuration-driven constraints to prevent unsafe optimizations. It adds a configuration option to control non-trivial else-branch hoisting, introduces per-thread variable tracking (threadIdx) to prevent incorrect unswitching, and adds utility functions for analyzing variable usage through Let bindings and statement side-effect detection. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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. Comment |
This PR makes LoopUnswitching more conservative by default, and adds an opt-in PassConfig to re-enable more aggressive hoisting.
Motivation:
Changes:
This keeps the canonical optimization -> while avoiding code-size blowups and unsafe control-flow splits by default.
Summary by CodeRabbit
New Features
Improvements
Tests