[llvm] [AMDGPU] Try to reuse in v_cndmask register with constant from compare. (PR #131146)
Daniil Fukalov via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 17 14:08:39 PDT 2025
dfukalov wrote:
> Is this going to match `X == +0.0 ? X : Y` -> `X == +0.0 ? +0.0 : Y`? That would be wrong, because if X is -0.0 then the first one evaluates to -0.0 and the second one evaluates to +0.0.
`X == Const ? X : Y -> X == Const ? Const : Y` optimisation is performed in InstCombine on llvm ir. Here I try to dial with cases it can degrade performance.
I double-checked the case `X == +0.0 ? X : Y` and actually InstCombine doesn't touch such operations and doesn't transform in to `X == +0.0 ? +0.0 : Y`, so there is no such issue.
https://github.com/llvm/llvm-project/pull/131146
More information about the llvm-commits
mailing list