Skip to content

Conversation

@s-perron
Copy link
Collaborator

This CL adds error handling to the MergeReturnPass to gracefully handle cases where the pass runs out of IDs.

The following functions were modified to return a boolean indicating success or failure:

  • AddNewPhiNodes
  • AddReturnFlag
  • AddReturnValue
  • BranchToBlock
  • CreatePhiNodesForInst
  • ProcessStructuredBlock
  • RecordReturned
  • UpdatePhiNodes

The callers of these functions were updated to check the return value and propagate the failure. This prevents the pass from crashing when it runs out of IDs.

This CL adds error handling to the MergeReturnPass to gracefully handle cases where the pass runs out of IDs.

The following functions were modified to return a boolean indicating success or failure:
- AddNewPhiNodes
- AddReturnFlag
- AddReturnValue
- BranchToBlock
- CreatePhiNodesForInst
- ProcessStructuredBlock
- RecordReturned
- UpdatePhiNodes

The callers of these functions were updated to check the return value and propagate the failure. This prevents the pass from crashing when it runs out of IDs.
@s-perron s-perron requested a review from luciechoi September 23, 2025 17:35
@s-perron s-perron merged commit f932fc2 into KhronosGroup:main Oct 1, 2025
22 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.

2 participants