[llvm] [AMDGPU] Fold fneg into select source modifiers (PR #201426)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 03:56:32 PDT 2026


jayfoad wrote:

> Add shouldFoldFNegIntoSelect to gate the fold between:
> 
> ```
>   fneg(select) <--> select(fneg, fneg)
> ```
> 
> * f32, choose select(fneg, fneg).
> * f64, choose fneg(select).

But for f64 we also want select(fneg, fneg), right? At least the final codegen we want is two v_cndmask_b32 where the one for the high halves uses the neg modifier.

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


More information about the llvm-commits mailing list