This is an archive of the discontinued LLVM Phabricator instance.

[X86][AVX] Extract SUBV_BROADCAST constant bits from just the lower subvector range (PR51281)
ClosedPublic

Authored by RKSimon on Jul 30 2021, 7:03 AM.

Details

Summary

As reported on PR51281, an internal fuzz test encountered an issue when extracting constant bits from a SUBV_BROADCAST node from a constant pool source larger than the broadcasted subvector width.

The getTargetConstantBitsFromNode was assuming that the Constant would the same size as the subvector, resulting in the incorrect packing of the per-element bits data.

This patch attempts to solve this by using the SUBV_BROADCAST node to determine the subvector width, and then ensuring we extract only the lowest bits from Constant of that subvector bitsize.

Diff Detail

Event Timeline

RKSimon created this revision.Jul 30 2021, 7:03 AM
RKSimon requested review of this revision.Jul 30 2021, 7:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 30 2021, 7:03 AM
andreadb accepted this revision.Aug 5 2021, 3:44 AM

LGTM

This revision is now accepted and ready to land.Aug 5 2021, 3:44 AM