Skip to content

gdb.rocm: step-schedlock-spurious-waves.cpp: Use inlined asm for breakpoint - #302

Open
akondrat-amd wants to merge 1 commit into
amd-stagingfrom
users/akondrat/spurious-waves-fix
Open

gdb.rocm: step-schedlock-spurious-waves.cpp: Use inlined asm for breakpoint#302
akondrat-amd wants to merge 1 commit into
amd-stagingfrom
users/akondrat/spurious-waves-fix

Conversation

@akondrat-amd

Copy link
Copy Markdown
Contributor

On gfx1250 the original code did not achieve full wavefront occupancy; VGPR pressure was created by the unoptimized function call and for loop.

Instead of relying on optnone + an empty end_of_kernel function as a breakpoint site, use forceinline with volatile inline assembly (s_nop 0). This guarantees the instruction is emitted in-line in the kernel and cannot be optimized away, giving the debugger a reliable address to break on.

Move optnone to kern to keep the s_sleep calls from being optimized, and replace the counted loop with explicit s_sleep calls to make the stepping sequence clearer.

More details in Jira [AIROCGDB-552]

…kpoint

On gfx1250 the original code did not achieve full wavefront
occupancy; VGPR pressure was created by the unoptimized function call
and for loop.

Instead of relying on optnone + an empty end_of_kernel function as a
breakpoint site, use __forceinline__ with volatile inline assembly
(s_nop 0).  This guarantees the instruction is emitted in-line in the
kernel and cannot be optimized away, giving the debugger a reliable
address to break on.

Move optnone to kern to keep the s_sleep calls from being optimized,
and replace the counted loop with explicit s_sleep calls to make the
stepping sequence clearer.
@akondrat-amd
akondrat-amd requested a review from a team as a code owner August 21, 2026 16:01
@lumachad

Copy link
Copy Markdown
Collaborator

We should go with either this one or #296. I've confirmed this one also works for O3 -flto. @lancesix ?

@lumachad

Copy link
Copy Markdown
Collaborator

We should go with either this one or #296. I've confirmed this one also works for O3 -flto. @lancesix ?

I'm fine with this fix. I just need it fixed so #245 is unblocked.

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.

2 participants