This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Simplify TargetLibraryInfo implementation
AbandonedPublic

Authored by gchatelet on Dec 15 2019, 5:12 AM.

Details

Reviewers
courbet
Summary

Use PackedBitVector instead of raw char array. This simplifies the implementation but also allocates on the heap instead of the stack; which is not ideal.
We could specialize PackedBitVector so it takes a SmallBitVector instead of the BitVector but looking at the implementation SmallBitVector is actually a TinyBitVector which can only pack a handful of bits.

At this point I'm not clear on the benefits of this patch. Feel free to push back.

Event Timeline

gchatelet created this revision.Dec 15 2019, 5:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2019, 5:12 AM

This makes the code easier to read indeed, but this comes at the expense of allocations and less locality, so I would refrain from doing this unless we have a good reason.
Or: gather some data in the codebase as to whether a template-parametric SmallBitVector would find other usages, implement it, and use it here as a 3rd parameter to PackedBitVector.

Either way I don't have a strong opinion on the matter, but I'm pretty sure other people might, so please add other reviewers.

llvm/include/llvm/Analysis/TargetLibraryInfo.h
396

Do that in a separate patch ?

gchatelet abandoned this revision.May 29 2020, 5:30 AM