[llvm] [AMDGPU] Swap V_CNDMASK operands to shrink it into VOP2 (PR #135162)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri May 2 11:58:37 PDT 2025


arsenm wrote:

> > It would probably be easier to handle this as a pre-selection combine
> 
> i need to check source modifiers to determine if the swap is beneficial , i can't check that in pre-selection combine

Not directly, no. But you can detect with high confidence if the source modifier patterns appear (in FP or integer form), it's just slightly inconvenient. 

However, we can just unconditionally prefer to place the constants in src0 in the compare + select pattern so it kind of doesn't matter

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


More information about the llvm-commits mailing list