This is an archive of the discontinued LLVM Phabricator instance.

[KnownBits] Add bit counting methods to KnownBits struct and use them where possible
ClosedPublic

Authored by craig.topper on May 5 2017, 8:43 PM.

Details

Summary

This patch adds min/max population count, leading/trailing zero/one bit counting methods.

The min methods return answers based on bits that are known without considering unknown bits. The max methods give answers taking into account the largest count that unknown bits could give.

Diff Detail

Event Timeline

craig.topper created this revision.May 5 2017, 8:43 PM
RKSimon accepted this revision.May 12 2017, 3:37 AM

LGTM with a couple of minor queries

include/llvm/Support/KnownBits.h
137

Maybe something like 'minimum known number' - same for the others below

138

I'd prefer that these were on separate lines but that's me.

This revision is now accepted and ready to land.May 12 2017, 3:37 AM
This revision was automatically updated to reflect the committed changes.