Skip to content

[mpmd] Refactor UniquifyFunctionInputsOutputsPass to use shared utilities.#1374

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_923636974
Open

[mpmd] Refactor UniquifyFunctionInputsOutputsPass to use shared utilities.#1374
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_923636974

Conversation

@copybara-service
Copy link
Copy Markdown

[mpmd] Refactor UniquifyFunctionInputsOutputsPass to use shared utilities.

Replace inline implementations in MergeInferredFragmentWithExisting with
shared utility functions from common/utils.h:

  • FindLastFragmentOnMesh replaces manual block scan loop
  • FindLatestOperandProducer replaces manual operand producer search
  • EnsureAfter replaces manual CanMoveAfter + moveAfter sequence
  • SaveFragmentAttrs / RestoreFragmentAttrs replaces manual attribute
    save/restore logic

This removes ~50 lines of duplicated code with no behavioral change.

…ties.

Replace inline implementations in MergeInferredFragmentWithExisting with
shared utility functions from common/utils.h:
- FindLastFragmentOnMesh replaces manual block scan loop
- FindLatestOperandProducer replaces manual operand producer search
- EnsureAfter replaces manual CanMoveAfter + moveAfter sequence
- SaveFragmentAttrs / RestoreFragmentAttrs replaces manual attribute
  save/restore logic

This removes ~50 lines of duplicated code with no behavioral change.

PiperOrigin-RevId: 923636974
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