[llvm] [AMDGPU][True16][CodeGen] sext i16 inreg in true16 mode (PR #144024)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 16 02:37:37 PDT 2025
================
@@ -2583,6 +2585,23 @@ def : GCNPat <
(i16 (DivergentSextInreg<i8> i16:$src)),
(V_BFE_I32_e64 $src, (i32 0), (i32 8))
>;
+}
+
+let True16Predicate = UseRealTrue16Insts in {
+def : GCNPat <
+ (i16 (DivergentSextInreg<i1> i16:$src)),
+ (V_BFE_I32_e64
+ (REG_SEQUENCE VGPR_32, VGPR_16:$src, lo16, (i16 (IMPLICIT_DEF)), hi16),
+ (i32 0), (i32 1))
+>;
----------------
jayfoad wrote:
I don't like this. AFAIX there is no single instruction that can do this, so really instead of this ugly pattern we should just say that i16 sext_inreg is not legal (when real true16 is enabled). Then it is the legalizer's job to legalize it, e.g. by promoting to i32, which is what this ugly pattern is doing anyway.
https://github.com/llvm/llvm-project/pull/144024
More information about the llvm-commits
mailing list