[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 13:05:20 PDT 2022
paquette added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:6074-6075
+ };
+ if (!Match(/*MaybeBinOp = */ LHS, /*X = */ RHS) &&
+ !Match(/*MaybeBinOp = */ RHS, /*X = */ LHS))
+ return false;
----------------
arsenm wrote:
> Should there be commutative variants of the matchers like in the IR version?
Yeah, something for G_ICMP on eq/ne would be useful. The binops already commute.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135380/new/
https://reviews.llvm.org/D135380
More information about the llvm-commits
mailing list