[PATCH] D135148: [GISel] Handle hi element extract in `matchTruncBuildVectorFold`

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 09:23:34 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:5929-5940
+  // Replace (G_TRUNC (G_LSHR (G_BITCAST (G_BUILD_VECTOR x, y)), K)) with
+  //    y if K == size of vector element type
+  Optional<ValueAndVReg> ShiftAmt;
+  if (mi_match(Src, MRI,
+               m_GLShr(m_GBitcast(m_GBuildVector(m_Reg(), m_Reg(MatchInfo))),
+                       m_GCst(ShiftAmt)))) {
+    LLT MatchTy = MRI.getType(MatchInfo);
----------------
This doesn't really have anything in common with the other fold here. Should it move to a separate match function?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135148



More information about the llvm-commits mailing list