[PATCH] D49554: [APInt] Keep the original bit width in quotient and remainder

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 19 09:30:31 PDT 2018


kparzysz created this revision.
kparzysz added reviewers: sanjoy, craig.topper.
Herald added a subscriber: dexonsmith.

Some trivial cases in udivrem were handled by directly assigning 0 or 1 to APInt objects. This would set the bit width to 1, instead of the bit width of the inputs. A potentially undesirable side effect of that is that with the bit width of 1, 1 equals -1.


Repository:
  rL LLVM

https://reviews.llvm.org/D49554

Files:
  lib/Support/APInt.cpp
  unittests/ADT/APIntTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49554.156294.patch
Type: text/x-patch
Size: 3459 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180719/ac97f709/attachment.bin>


More information about the llvm-commits mailing list