[PATCH] D132671: [RISCV] Teach combineDeMorganOfBoolean to handle (and (xor X, 1), (not Y)).

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 09:49:16 PDT 2022


reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

LGTM w/comment addressed.



================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:8435
+
+  // For AND, SimplifyDemandedBits may have turned (xor X, 1) into (xor X, -1)
+  // because other operand is boolean. Because of this we allow (xor X, 1)
----------------
Can you reword this comment to emphasize the bit about allowing only one of the two to xor N, -1?  It's the bit about the other still needing to be 0/1 for the demanded bits to work out that I had missed in the original read through.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132671



More information about the llvm-commits mailing list