[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 14:13:04 PST 2023


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:6634
 
+  if (areBitwiseNotOfEachother(N0, N1))
+    return DAG.getConstant(APInt::getZero(N1.getScalarValueSizeInBits()),
----------------
RKSimon wrote:
> Don't bother with the helper - just inline the check.
Keep areBitwiseNotOfEachother - sorry I didn't see D145177 :)


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