[llvm] [AMDGPU][True16][CodeGen] build_vector pattern in true16 (PR #118904)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 6 06:55:03 PST 2024
================
@@ -3322,12 +3327,25 @@ def : GCNPat <
(S_PACK_LL_B32_B16 SReg_32:$src0, SReg_32:$src1)
>;
+foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
+let True16Predicate = p in
// Take the lower 16 bits from each VGPR_32 and concat them
def : GCNPat <
(vecTy (DivergentBinFrag<build_vector> (Ty VGPR_32:$a), (Ty VGPR_32:$b))),
(V_PERM_B32_e64 VGPR_32:$b, VGPR_32:$a, (S_MOV_B32 (i32 0x05040100)))
>;
+let True16Predicate = UseRealTrue16Insts in {
+def : GCNPat <
+ (vecTy (DivergentBinFrag<build_vector> (Ty VGPR_16:$a), (Ty VGPR_16:$b))),
+ (REG_SEQUENCE VGPR_32, VGPR_16:$a, lo16, VGPR_16:$b, hi16)
+>;
+// GISel ignores this Pat, but the equivalent is done in selectG_BUILD_VECTOR
+def : GCNPat <
+ (vecTy (build_vector (Ty VGPR_16:$src0), (Ty undef))),
+ (REG_SEQUENCE VGPR_32, $src0, lo16, (IMPLICIT_DEF), hi16)
----------------
arsenm wrote:
May need explicit classes on the output operands to get the gisel import
https://github.com/llvm/llvm-project/pull/118904
More information about the llvm-commits
mailing list