[PATCH] D118094: [InstCombine] Implementing (x & y) + ~(x | y) -> ~(x ^ y)

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 25 01:23:13 PST 2022


ChuanqiXu added a comment.

In D118094#3268554 <https://reviews.llvm.org/D118094#3268554>, @lebedev.ri wrote:

> Please fix the patch's description.

Do you mean the URL in the description? I would delete it when this one get committed.

> Should this go into `have no common bits` check instead?

I don't understand why this could go into "have no common bits". Since (x & y) and  ~(x | y) could have common bits 0 if x is 1 and y is 0. Did I misunderstand something?



================
Comment at: llvm/test/Transforms/InstCombine/pr53357.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; Test for (x & y) + ~(x | y) -> ~(x ^ y)
----------------
xbolva00 wrote:
> ChuanqiXu wrote:
> > ChuanqiXu wrote:
> > > nikic wrote:
> > > > The check lines don't look like update_test_checks output.
> > > My bad, I just copied this one from other tests. Do you think what should I do? Remove this one simply?
> > I found several tests contain the line. For example: https://github.com/llvm/llvm-project/commit/732a90da785de2f61dbbf09d6c5fe55937d194b6 and https://github.com/llvm/llvm-project/commit/fc8f1e4419d338a347bade7cfc76f73052f00739. And I add it for consistency. Do you think we need to remove them?
> You should remove current checks and use that script to generate them properly.
Thanks! I didn't know this before. I wrote all the tests by hand in the past.


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

https://reviews.llvm.org/D118094



More information about the llvm-commits mailing list