[llvm] [AMDGPU][GlobalISel] Eliminate READANYLANE round trips in mixed build_vector/merge (PR #210449)

Anshil Gandhi via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 19:11:16 PDT 2026


gandhi56 wrote:

@petar-avramovic I filed #217800 for the large sgpr to vgpr copy discussion, so it has a home outside this review.

Beyond quoting your point about contiguous sgpr allocation and per-element copies, I added the register/instruction measurements from this patch, the reason the "could the user have taken an sgpr" question can't be answered at generic MIR (it's a constant bus question, so `SIInstrInfo::isOperandLegal` is the only real oracle), and a correctness hazard I hit prototyping the transform after `SIFoldOperands` — a genuine `llvm.amdgcn.readfirstlane` is indistinguishable from a redundant round trip once both select to `V_READFIRSTLANE_B32`.

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


More information about the llvm-commits mailing list