Skip to content

Add cycle detection to ResourceSharingPass::PerformFoldingActions.#4056

Draft
copybara-service[bot] wants to merge 1 commit intomainfrom
test_895433062
Draft

Add cycle detection to ResourceSharingPass::PerformFoldingActions.#4056
copybara-service[bot] wants to merge 1 commit intomainfrom
test_895433062

Conversation

@copybara-service
Copy link
Copy Markdown

Add cycle detection to ResourceSharingPass::PerformFoldingActions.

This change modifies the PerformFoldingActions function to check that the introduction of priority_sel input selection would not introduce a cycle when the folded nodes are merged together. This is to ensure the pass does not produce an unrecoverable error that would otherwise occur when the next pass attempts to iterate nodes using DfsVisitor.

This does not yet solve the underlying bug in folding action legalization or analysis that exists but surfaces that error in a more usable way.

This change modifies the PerformFoldingActions function to check that the introduction of priority_sel input selection would not introduce a cycle when the folded nodes are merged together. This is to ensure the pass does not produce an unrecoverable error that would otherwise occur when the next pass attempts to iterate nodes using DfsVisitor.

This does not yet solve the underlying bug in folding action legalization or analysis that exists but surfaces that error in a more usable way.

PiperOrigin-RevId: 895433062
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.

1 participant