[llvm] [AMDGPU] Only treat unconditional branches as implicit XCNT drains (PR #219206)
Madhur Kumar via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 07:18:36 PDT 2026
MadhurKumar004 wrote:
> I assume SIInsertWaitcnts relies on the existence of a branch that SIPreEmitPeephole later optimizes away? Is it a S_CBRANCH_EXECZ?
The root cause is that SIInsertWaitcnts assumes any branch implicitly drains XCNT, but on gfx1250 xcnt is only drained by a real PC change, A conditional branch that falls through does not change the PC and therefore does not drain XCNT.
So even if SIPreEmitPeephole never run, the original program in the issue is already buggy on the fallthrough path.
https://github.com/llvm/llvm-project/pull/219206
More information about the llvm-commits
mailing list