[llvm] [AArch64][GlobalISel] Combine G_EXTRACT_VECTOR_ELT and G_BUILD_VECTOR sequences into G_SHUFFLE_VECTOR (PR #110545)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 22 16:09:22 PDT 2024
================
@@ -905,6 +905,16 @@ def extract_vec_elt_build_vec : GICombineRule<
[{ return Helper.matchExtractVecEltBuildVec(*${root}, ${matchinfo}); }]),
(apply [{ Helper.applyExtractVecEltBuildVec(*${root}, ${matchinfo}); }])>;
+def extract_vector_register_to_id_mapping_matchinfo :
+ GIDefMatchData<"SmallVector<std::pair<Register, int>>">;
+def vector_reg_pair_matchinfo :
+ GIDefMatchData<"std::pair<Register, Register>">;
+def extract_vector_element_build_vector_to_shuffle_vector : GICombineRule<
+ (defs root:$root, extract_vector_register_to_id_mapping_matchinfo:$matchinfo, vector_reg_pair_matchinfo:$regpair),
+ (match (wip_match_opcode G_BUILD_VECTOR):$root,
----------------
ValentijnvdBeek wrote:
@tschuett I fixed this in a fixup commit for powers of two (from what I could find also AMDGPU uses those as registers sizes). There seems to be a cap for the amount of patterns that can be supported (1024x8, 2048x16, 4096x32) and it does add a lot of extra lines. Just this pattern now takes 25-30% of the file and patterns around it should also be changed to this.
https://github.com/llvm/llvm-project/pull/110545
More information about the llvm-commits
mailing list