[llvm] [AMDGPU][VOPD] Limit VOPDPairing from reaching over load dependencies (PR #201930)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 07:28:53 PDT 2026


jayfoad wrote:

> One problem is that, from what I can see, there aren't actually any memory clustering edges before VOPD pairing (post-RA).

Hmm, maybe just because of the order in which various DAG mutations are applied?

> I would also argue that the pairs `VOPDPairingMutation` tries to add are not necessarily worth preserving in the first place; the formation of them is greedy and made without any consideration of dependencies at all, currently. This means that it's inevitably pushing for some infeasible pairings, and this may come at the cost of pairings that could validly be made instead.

You think we should remove it completely?? I think one reason we need it is that for the later VOPDCombine pass to work, the instructions being combined need to be exactly adjacent, not just close to each other. I guess we could change this design, and give VOPDCombine the power to do simple code reorderings so it can combine non-adjacent instructions.

> I know the check I add in this patch is ad hoc; I think a proper fix in this direction requires more thought, but I wanted to get a conversation started

Thanks, I appreciate that!

https://github.com/llvm/llvm-project/pull/201930


More information about the llvm-commits mailing list