[llvm] [AMDGPU] select v_sat_pk from two i16 or v2i16 (PR #121124)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 01:59:04 PST 2025


Shoreshen wrote:

> I think the approach of using these patterns should be revisited. These patterns are unwieldy and duplicate generic combiner logic.
> 
> We should be using the generic TRUNCATE__SAT_ nodes. The only issue is that we don't want to make v2i8 legal, but we do not have to. We can custom lower these nodes on the illegal v2i8 type, use a target specific node and bitcast from the packed-as-i16 form of the instruction to the v2i8

Hi @arsenm , we can use TRUNCATE_SSAT_U node for the i16 case, but the vector case maybe not, since the result of the truncation is v2i8, which causes compilation fail for the current backend I think

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


More information about the llvm-commits mailing list