[PATCH] D119629: [DAG] computeKnownBits - add ISD::AVGCEILU handling

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 13 08:29:02 PST 2022


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3138-3139
+    KnownBits One = KnownBits::makeConstant(APInt(BitWidth + 1, 1));
+    Known = KnownBits::computeForAddSub(true, false, Known, Known2);
+    Known = KnownBits::computeForAddSub(true, false, Known, One);
+    Known = Known.extractBits(BitWidth, 1);
----------------
foad wrote:
> I think you could do all of this with a single call to computeForAddCarry with carry-in known to be 1.
Nice catch!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119629



More information about the llvm-commits mailing list