[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:21:12 PDT 2025
dfukalov wrote:
> > I tried to detect these cases and revert the optimisation in amdgpu-codegenprepare, but realised that in some cases (e.g. when immediate can be encoded into instruction, depending on the target and the constant) it can increase registers usage (as well as instructions count).
>
> That would be too late, plenty of compare and select patterns appear during legalization
I guess the exact pattern with same imms in two registers in cmp/select is not quite common. Moreover, in case we're getting it at the folding stage, it would be also profitable to spare a register.
https://github.com/llvm/llvm-project/pull/131146
More information about the llvm-commits
mailing list