-
Notifications
You must be signed in to change notification settings - Fork 14
Generate Code pass - update phi_start handle #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR extends the Generate Code pass to properly handle PhiStartOp operations in addition to PhiOp operations. Previously, only PhiOp was recognized when building the reserve-to-phi mapping, causing PhiStartOp operands to remain unresolved during code generation.
- Renamed
isPhitoisPhiLiketo check for bothPhiOpandPhiStartOp - Added
getReserveOperandhelper function to correctly extract the reserve operand from both phi operation types (operand 0 forPhiOp, operand 1 forPhiStartOp) - Updated test expectations to reflect properly resolved operands instead of "UNRESOLVED, ERROR"
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/NeuraDialect/Transforms/GenerateCodePass.cpp | Adds support for PhiStartOp by introducing isPhiLike and getReserveOperand helper functions, and updating the reserve-to-phi mapping logic |
| test/e2e/histogram/histogram_kernel.mlir | Updates test expectation to show resolved operand [WEST, RED] instead of [UNRESOLVED, ERROR] for PHI_START instruction |
| test/e2e/fir/fir_kernel.mlir | Updates test expectations to show resolved operand [EAST, RED] instead of [UNRESOLVED, ERROR] for PHI_START instruction, and adds expected CTRL_MOV instruction |
| test/e2e/bicg/bicg_kernel.mlir | Updates test expectations to show resolved operands [$2] and [$1] instead of [UNRESOLVED, ERROR] for PHI_START instructions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ShangkunLi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~
No description provided.