[PATCH] D109555: [APInt] Enable APInt to support zero bit integers.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 9 17:36:01 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/include/llvm/ADT/APInt.h:579
       BitWidth = RHS.BitWidth;
-      return clearUnusedBits();
+      return *this;
     }
----------------
lattner wrote:
> craig.topper wrote:
> > Why don't we need to clearUnusedBits here?
> I can split this out to a different patch if you prefer.  It just isn't needed.  RHS is already a well formed APInt, so it already has the right zero bits at the top.
Couldn't `RHS` have more bits than `this` which would require the bits to be removed?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109555



More information about the llvm-commits mailing list