Tihs patches adds APInt::count{l,r}_{zero,one} and APInt::popcount to
be consistent with those functions in ADT/bit.h.
Once this patch lands, I'll take care of the migration.
For now, I am intentionally leaving isPowerOf2 as is.
| Paths 
 |  Differential  D144165  
[ADT] Provide C++20-style bit functions ClosedPublic Authored by kazu on Feb 16 2023, 12:13 AM. 
Details Summary Tihs patches adds APInt::count{l,r}_{zero,one} and APInt::popcount to Once this patch lands, I'll take care of the migration. For now, I am intentionally leaving isPowerOf2 as is. 
Diff Detail 
 Event TimelineThis revision is now accepted and ready to land.Feb 16 2023, 10:42 AM Closed by commit rG7c9df7743521: [ADT] Provide C++20-style bit functions (authored by kazu).  ·  Explain WhyFeb 16 2023, 8:13 PM This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
Diff 498243 llvm/include/llvm/ADT/APInt.h
 llvm/unittests/ADT/APIntTest.cpp
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||