Skip to content

Conversation

@n0thingNoob
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a 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 isPhi to isPhiLike to check for both PhiOp and PhiStartOp
  • Added getReserveOperand helper function to correctly extract the reserve operand from both phi operation types (operand 0 for PhiOp, operand 1 for PhiStartOp)
  • 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.

Copy link
Collaborator

@ShangkunLi ShangkunLi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~

@tancheng tancheng merged commit 3ac777e into main Dec 25, 2025
1 check 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.

4 participants