[PATCH] D135380: [GlobalISel] Combine (X op Y) == X --> Y == 0

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 11:13:32 PDT 2022


paquette created this revision.
paquette added reviewers: aemerson, arsenm.
Herald added subscribers: hiraditya, rovka.
Herald added a project: All.
paquette requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

This matches patterns of the form

  (X op Y) == X

And transforms them to

  Y == 0

where appropriate.

Example: https://godbolt.org/z/hfW811c7W


https://reviews.llvm.org/D135380

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
  llvm/include/llvm/Target/GlobalISel/Combine.td
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/combine-icmp-of-binop-to-icmp-of-0.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135380.465795.patch
Type: text/x-patch
Size: 35861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221006/1e0c7cc7/attachment.bin>


More information about the llvm-commits mailing list