[PATCH] D99283: [GlobalISel] Combine and (lshr x, cst), mask -> ubfx x, cst, width

Jon Roelofs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 29 15:57:01 PDT 2021


jroelofs accepted this revision.
jroelofs added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:4002
+  if (!mi_match(MI.getOperand(0).getReg(), MRI,
+                m_GAnd(m_OneNonDBGUse(m_GLShr(m_Reg(ShiftSrc), m_ICst(LSBImm))),
+                       m_ICst(AndImm))))
----------------
Depending on subtarget-specific latencies, this may be worthwhile even when the shift has more than one use if `lat(ubfx) < lat(and) + lat(lshr)`.


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

https://reviews.llvm.org/D99283



More information about the llvm-commits mailing list