This is an archive of the discontinued LLVM Phabricator instance.

[TargetLowering] Increase the storage size of NumRegistersForVT to allow the type break down for v256i1 and other types to be stored correctly
ClosedPublic

Authored by craig.topper on Nov 12 2019, 11:49 AM.

Details

Summary

v256i1 on X86 without avx512 breaks down to 256 i8 values when passed between basic blocks. But the NumRegistersForVT was sized at a byte for each VT. This results in 256 being stored as 0.

This patch enlarges the type to 16 bits and adds an assert to ensure that no information is lost when the entry is stored.

Diff Detail

Event Timeline

craig.topper created this revision.Nov 12 2019, 11:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 12 2019, 11:49 AM
spatel accepted this revision.Nov 13 2019, 5:30 AM

LGTM

llvm/include/llvm/CodeGen/TargetLowering.h
2744

Not sure if it makes any difference jumping up to straight 32-bit "unsigned", but since we have an assert now, this should be ok.

This revision is now accepted and ready to land.Nov 13 2019, 5:30 AM
RKSimon accepted this revision.Nov 13 2019, 6:13 AM

LGTM, but like @spatel mentioned, just using unsigned would make sense as well

This revision was automatically updated to reflect the committed changes.