[PATCH] D156315: [RFC][GlobalISel] Overhauled MIR Patterns Support for Combiners

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 01:55:39 PDT 2023

Pierre-vh added inline comments.

Comment at: llvm/docs/GlobalISel/MIRPatterns.rst:49
+  * typed, unnamed: ``(i32 0)``
+  * typed, named: ``(i32 0):$y``
arsenm wrote:
> Do these support vectors. i.e. can you use a constant and implicitly get a constant splat? vector constants are a recurring pain point
The operand's type is checked, so `0` can match a splat, but `i32 0` can only match a constant of type i32 (a register).
See `match-table-imms.td` InstTest0 vs InstTest1

Comment at: llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp:2491
+  ParsedPatFrags[Def] = std::move(NewPatFrag);
+  SeenPatFrags.insert(Res);
+  return Res;
arsenm wrote:
> Move the insert before the move?
I still need to return the pointer after so I need to save it anyway, so it doesn't matter if I do `SeenPatFrags.insert(NewPatFrag.get());`

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list