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

Mirko Brkusanin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 08:50:46 PST 2020


mbrkusanin created this revision.
mbrkusanin added reviewers: arsenm, foad.
mbrkusanin added a project: LLVM.
Herald added subscribers: kerbowa, hiraditya, rovka, nhaehnle, jvesely.
mbrkusanin requested review of this revision.
Herald added a subscriber: wdng.

If we have a mask, and a value x, where (x | mask) == x, we can drop the OR
and just use x.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90952

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
  llvm/include/llvm/Target/GlobalISel/Combine.td
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/lib/Target/AArch64/AArch64Combine.td
  llvm/test/CodeGen/AMDGPU/GlobalISel/combine-or-redundant.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/combine-shift-of-shifted-logic.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/sdiv.i64.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/srem.i64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90952.303470.patch
Type: text/x-patch
Size: 17727 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201106/ba970da1/attachment.bin>


More information about the llvm-commits mailing list