[PATCH] D124930: [DagCombine] Fold (X & ~Y) | Y with truncated not

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 09:01:45 PDT 2022


RKSimon added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1691
 
+/// If \p V is a bitwise note, returns the inverted operand. Otherwise returns
+/// and empty SDValue. Only bits set in \p Mask are required to be inverted,
----------------
note -> node


================
Comment at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1692
+/// If \p V is a bitwise note, returns the inverted operand. Otherwise returns
+/// and empty SDValue. Only bits set in \p Mask are required to be inverted,
+/// other bits may be arbitrary.
----------------
an empty SDValue


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:4688
 // Only bits set in Mask must be negated, other bits may be arbitrary.
-static SDValue getBitwiseNotOperand(SDValue V, SDValue Mask) {
-  if (isBitwiseNot(V, true))
+SDValue llvm::getBitwiseNotOperand(SDValue V, SDValue Mask, bool AllowUndefs) {
+  if (isBitwiseNot(V, AllowUndefs))
----------------
Would this be more generally useful if we replaced Mask with a APInt DemandedBits?


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

https://reviews.llvm.org/D124930



More information about the llvm-commits mailing list