[TIR] Handle Bind in LowerDeviceKernelLaunch#18912
[TIR] Handle Bind in LowerDeviceKernelLaunch#18912MasterJH5574 wants to merge 1 commit intoapache:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue where the Common Subexpression Elimination (CSE) pass inadvertently introduced Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses a crash in the Common Subexpression Elimination (CSE) pass when dealing with thread_extent attributes. The fix correctly prevents CSE from processing expressions within thread_extent values in both the CSEPlanner and CSERewriter, which resolves the issue with a later LowerDeviceKernelLaunch pass. The changes are well-targeted, and the new test case effectively validates the fix. I have one minor suggestion to improve code consistency.
| if (body.same_as(op->body)) { | ||
| return ffi::GetRef<Stmt>(op); | ||
| } | ||
| return AttrStmt(op->node, op->attr_key, op->value, body); |
There was a problem hiding this comment.
|
would be good to cross check and deep deeper to see if lowe |
22efd83 to
74cd126
Compare
74cd126 to
4bd380d
Compare
DeviceInfoCollector did not track Bind statements, so when CSE (or any other pass) inserted a Bind before a thread_extent AttrStmt, the collected extent referenced a locally-bound variable instead of function parameters. LowerDeviceKernelLaunch then produced dangling references in the host function. Fix: record Bind definitions in DeviceInfoCollector and inline them when extracting thread_extent values and dynamic shared memory sizes.
4bd380d to
30c6f62
Compare
DeviceInfoCollector did not track Bind statements, so when CSE (or
any other pass) inserted a Bind before a thread_extent AttrStmt, the
collected extent referenced a locally-bound variable instead of
function parameters. LowerDeviceKernelLaunch then produced dangling
references in the host function.
Fix: record Bind definitions in DeviceInfoCollector and inline them
when extracting thread_extent values and dynamic shared memory sizes.