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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 02:05:29 PST 2020


foad accepted this revision.
foad added a reviewer: paquette.
foad added a comment.
This revision is now accepted and ready to land.

LGTM modulo minor comments inline.



================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h:441
+  /// success.
+  bool matchOrWithRedundantMask(MachineInstr &MI, Register &Replacement);
+
----------------
`matchRedundantOr`?


================
Comment at: llvm/include/llvm/Target/GlobalISel/Combine.td:393
 
+// Fold (x | mask) -> x when (x | mask) is known to equal x.
+def or_redundant_mask_matchinfo : GIDefMatchData<"Register">;
----------------
Update comment to say that (x | y) could be simplified to either x or y.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90952



More information about the llvm-commits mailing list