[llvm] [AMDGPU][True16][CodeGen] stop emitting spgr_lo16 from isel (PR #144819)

Brox Chen via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 26 10:16:13 PDT 2025


broxigarchen wrote:

> I like the overall direction of this patch, but there are things I don't understand.
> 
> Are we heading towards a deisgn where SGPR_LO16 is never used and can be removed from the compiler?

Hi Jay. My understanding is that we might still want to fully support sgpr16 one day? I noticed that there are several places processing SGPR_LO16 in the code, and I did not plan to remove those.  This patch just stop generates the sgpr_lo16 from ISel, and this might be enabled again later when someone starts to work on sgpr16.

> Why is legalizeOperandsVALUt16 called separately from legalizeOperands? It seems like something that should just be a part of legalizeOperands.

We used to do that in legalizeOperands, but had a discussion with Matt and it seems the legalizeOperand is a hack for constant bus restriction (see https://github.com/llvm/llvm-project/pull/131859/files#r2002366361)

The other reason to seperate them is that this legalizet16 call is needed just because we don't have spgr16. It can be removed if we have sgpr16 in place


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


More information about the llvm-commits mailing list