[PATCH] D85463: [GlobalISel] Add combine for (x & mask) -> x when (x & mask) == x

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 12:49:34 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1807
+  assert(MI.getOpcode() == TargetOpcode::G_AND);
+  if (!KB)
+    return false;
----------------
I would kind of expect combines to be marked with requiring this, and the generated matcher table would understand to skip this if known bits isn't available


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1815
+  LLT DstTy = MRI.getType(AndDst);
+  if (DstTy.isVector())
+    return false;
----------------
I don't see why vectors wouldn't work


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

https://reviews.llvm.org/D85463



More information about the llvm-commits mailing list