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

Zach Goldthorpe via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 07:50:46 PDT 2026


zGoldthorpe wrote:

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

>From what I understand, the loads are pairwise clustered pre-RA, but after regalloc, since the loads do not share the same base address, they do not get clustered at all.

> 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.

Oh no, I'm not arguing that this mutation should be removed! I only mean that since the current implementation of VOPDpairing is greedy, some of the pairing edges it outputs will be suboptimal and skew scheduling decisions unfavourably (as we see in the lit test I added). While we could in principle work around poorly-selected pairing edges, I was just arguing that perhaps it's better to try to have VOPDpairing output better pairing edges.

Since VOPDpairing will "commit" to trying to pair a VOPD-friendly instruction at most once, having it not try to commit to a bad pairing may free up those instructions to be paired with others that are actually feasible.

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


More information about the llvm-commits mailing list