This is an archive of the discontinued LLVM Phabricator instance.

[APInt] Keep the original bit width in quotient and remainder
ClosedPublic

Authored by kparzysz on Jul 19 2018, 9:30 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

kparzysz created this revision.Jul 19 2018, 9:30 AM
This revision is now accepted and ready to land.Jul 19 2018, 10:47 AM
This revision was automatically updated to reflect the committed changes.