Skip to content

[mpmd] Add fragment query, positioning, and attribute save/restore utilities with tests.#1375

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

[mpmd] Add fragment query, positioning, and attribute save/restore utilities with tests.#1375
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_923636972

Conversation

@copybara-service
Copy link
Copy Markdown

[mpmd] Add fragment query, positioning, and attribute save/restore utilities with tests.

Add reusable utility functions to common/utils.{h,cc}:

  • FindLastFragmentOnMesh / FindFirstFragmentOnMesh: scan a block for fragment ops on a given mesh, with exclude list support
  • FindLatestOperandProducer: find the latest (in block order) op that defines any operand
  • CanMoveAfter / EnsureAfter: safely reposition ops without breaking use-def chains
  • SaveFragmentAttrs / RestoreFragmentAttrs: save and restore inferred_by and call_counter attributes across MergeRegionOps

Add comprehensive unit tests (26 new test cases) covering all functions with edge cases.

…ilities with tests.

Add reusable utility functions to common/utils.{h,cc}:
- FindLastFragmentOnMesh / FindFirstFragmentOnMesh: scan a block for fragment ops on a given mesh, with exclude list support
- FindLatestOperandProducer: find the latest (in block order) op that defines any operand
- CanMoveAfter / EnsureAfter: safely reposition ops without breaking use-def chains
- SaveFragmentAttrs / RestoreFragmentAttrs: save and restore inferred_by and call_counter attributes across MergeRegionOps

Add comprehensive unit tests (26 new test cases) covering all functions with edge cases.

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