[llvm] [AMDGPU][AMDGPULateCodeGenPrepare] Combine scalarized selects back into vector selects (PR #173990)

Pankaj Dwivedi via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 30 09:19:23 PST 2025


PankajDwivedi-25 wrote:

> This seems more like a job for SLPVectorizer

The pattern here is reversing scalarization that happens through AMDGPU's lowering (bitcast→extract→select), not forward SLP-style vectorization. It also requires AMDGPU-specific cost knowledge - on AMDGPU, a uniform i1 condition doesn't need splatting (uses SCC), making vector select cheap. Adding this understanding to SLP's cost model would be invasive and may not benefit other targets.

I think it is more towards target-specific late cleanup, if you still feel like it should be handled in SLP i will try to add it.

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


More information about the llvm-commits mailing list