[PATCH] D145143: [DAGCombiner] Add fold for `~x & x` -> `0`

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 03:29:37 PST 2023


RKSimon added a comment.

Did you look at performing this inside SimplifyDemandedBits instead?



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:6630
+    return Op0.getOpcode() == ISD::XOR && Op0.getOperand(0) == Op1 &&
+           isAllOnesOrAllOnesSplat(Op0.getOperand(1));
+  };
----------------
Use isBitwiseNot / getBitwiseNotOperand ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145143



More information about the llvm-commits mailing list