This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use APInt instead of SmallBitVector for tracking undef elements in constant pool shuffle decoding
ClosedPublic

Authored by craig.topper on Feb 26 2017, 6:17 PM.

Details

Summary

SmallBitVector uses a malloc for more than 58 bits on a 64-bit target and more than 27 bits on a 32-bit target. Some of the vector types we deal with here use more than those number of elements and therefore cause a malloc.

APInt on the other hand supports up to 64 bits without a malloc. That's the maximum number of bits we need here so we can avoid a malloc for all cases by using APInt. This will incur a minor increase in stack usage due to APInt storing the bit count separately from the data bits unlike SmallBitVector, but that should be ok.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Feb 26 2017, 6:17 PM
RKSimon accepted this revision.Feb 27 2017, 6:25 AM

LGTM

This revision is now accepted and ready to land.Feb 27 2017, 6:25 AM
This revision was automatically updated to reflect the committed changes.