Skip to content

[AMDGPU][SIInsertWaitcnts] Fix iota_range assertion when OtherMarks is empty in mergeAsyncMarks() - #193499

Merged
arsenm merged 10 commits into
llvm:mainfrom
xiaohuguo2023:fix/si-insert-waitcnts-87717bf9
May 1, 2026
Merged

arsenm merged 10 commits into
llvm:mainfrom
xiaohuguo2023:fix/si-insert-waitcnts-87717bf9

Conversation

@xiaohuguo2023

Copy link
Copy Markdown
Contributor

WaitcntBrackets::mergeAsyncMarks() asserts when merging async wait-count
state at a CFG join point where one predecessor has pending async memory
operations and the other does not.

Problem:

  • The existing early-exit only handles the both-empty case
  • When OtherMarks is empty but AsyncMarks is not, MergeCount = min(0, N) = 0
  • seq_inclusive(1, 0) fires: "Assertion Begin <= End failed"

Changes:

  • Add early return when MergeCount == 0 (OtherMarks is empty)
  • When the other predecessor contributed no async marks, our marks are
    unchanged and no stricter waits are needed
  • Add regression lit test: asyncmark-merge-empty-other.mir

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants