This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use APInt instead of SmallBitVector for tracking Zeroable elements in shuffle lowering
ClosedPublic

Authored by craig.topper on Feb 26 2017, 9:20 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.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Feb 26 2017, 9:20 PM
RKSimon accepted this revision.Feb 27 2017, 6:24 AM

Looks fine to me with a couple of minor suggestions.

lib/Target/X86/X86ISelLowering.cpp
8104 ↗(On Diff #89836)

How useful would it be to change APInt::setBit(int pos) to APInt::setBit(int pos, bool val = true)?

26827 ↗(On Diff #89836)

Zeroable.getBoolValue() ?

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