[PATCH] D88060: [GISel]: Few InsertVecElt combines

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 15 01:37:53 PDT 2020


foad added inline comments.


================
Comment at: llvm/include/llvm/Target/GlobalISel/Combine.td:521
+
+def insert_vec_elt_combines : GICombineGroup<[combine_consecutive_insert_vec_elts,
+                                              combine_ins_vec_build_vec]>;
----------------
Line length.


================
Comment at: llvm/include/llvm/Target/GlobalISel/Combine.td:551
 
-def all_combines : GICombineGroup<[trivial_combines, ptr_add_immed_chain,
+def all_combines : GICombineGroup<[trivial_combines, insert_vec_elt_combines, ptr_add_immed_chain,
     combines_for_extload, combine_indexed_load_store, undef_combines,
----------------
Line length.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:2462
+  // If we didn't end in a G_IMPLICIT_DEF, bail out.
+  return TmpInst->getOpcode() == TargetOpcode::G_IMPLICIT_DEF;
+}
----------------
It seems like it would be very easy to handle G_BUILD_VECTOR here as well as G_IMPLICIT_DEF. Then it will handle a chain of G_INSERT_VECTOR_ELT ending in a G_BUILD_VECTOR, with no need for a separate match function. Win-win?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88060/new/

https://reviews.llvm.org/D88060



More information about the llvm-commits mailing list