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

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 23:40:25 PST 2023


goldstein.w.n marked an inline comment as done.
goldstein.w.n added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:6636
+    return DAG.getConstant(APInt::getZero(N1.getScalarValueSizeInBits()),
+                           SDLoc(N), N1.getValueType());
+
----------------
RKSimon wrote:
> Use VT instead of getScalarValueSizeInBits/getValueType
Also change for the `add` patch.


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