[all-commits] [llvm/llvm-project] d88791: [AMDGPU][SIInsertWaitcnts] Fix underflow in expand...

Akash Dutta via All-commits all-commits at lists.llvm.org
Wed Jun 10 07:43:12 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d88791498d2ba453a393ea72a3dc76384f8a7804
      https://github.com/llvm/llvm-project/commit/d88791498d2ba453a393ea72a3dc76384f8a7804
  Author: Akash Dutta <137309513+akadutta at users.noreply.github.com>
  Date:   2026-06-10 (Wed, 10 Jun 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
    A llvm/test/CodeGen/AMDGPU/expand-waitcnt-profiling-no-outstanding.ll

  Log Message:
  -----------
  [AMDGPU][SIInsertWaitcnts] Fix underflow in expand-waitcnt-profiling when Outstanding is 0 on Pre-GFX12 (#202465)

When -amdgpu-expand-waitcnt-profiling expands a wait and the number of
outstanding operations for a counter is 0, "--Outstanding" wraps 0 to
UINT_MAX looping ~4 billion times. -amdgpu-waitcnt-forcezero
deterministically requests an all-zero wait even when nothing is
outstanding (e.g. before the first instruction), exercising that edge.
The GFX12+ generator already guarded against the wrap; this does the
same for PreGFX12.

The test in this PR should show the existing infinite loop problem that
this PR aims to fix.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list