This is an archive of the discontinued LLVM Phabricator instance.

[APInt] Remove calls to clearUnusedBits from XorSlowCase and operator^=
ClosedPublic

Authored by craig.topper on Jan 22 2017, 12:34 AM.

Details

Summary

There's a comment in XorSlowCase that says "0^0==1" which isn't true. 0 xored with 0 is still 0. So I don't think we need to clear any unused bits here.

Now there is no difference between XorSlowCase and AndSlowCase/OrSlowCase other than the operation being performed

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jan 22 2017, 12:34 AM
chfast added a subscriber: chfast.Jan 22 2017, 11:20 AM

Looks good, but adding an unit test for this case would be nice...

Add some unit tests for 1-bit and/or/xor.

MatzeB accepted this revision.Jan 23 2017, 9:54 AM

LGTM. unittests may also be interesting with the neg_one value (which I had rather called all_ones`.

This revision is now accepted and ready to land.Jan 23 2017, 9:54 AM
This revision was automatically updated to reflect the committed changes.