[llvm] [AMDGPU] Optimize away v_readfirstlane_b32 on SGPR input (PR #151033)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 29 05:59:08 PDT 2025


jayfoad wrote:

Can you add a more end-to-end test, as an example of where this would help real code?

Normally this kind of thing is handled in SIFoldOperands:
https://github.com/llvm/llvm-project/blob/29e02d792b8cc1bf9017a9ca90b3d9f7cff56fb6/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp#L1403
Is there some reason we can't extend that to work for this case too?

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


More information about the llvm-commits mailing list