This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Ensure small mask BUILD_VECTORs aren't expanded
ClosedPublic

Authored by frasercrmck on May 19 2021, 6:12 AM.

Details

Summary

The default expansion for BUILD_VECTORs -- save for going through
shuffles -- is to go through the stack. This method only works when the
type is at least byte-sized, so for v2i1 and v4i1 we would crash.

This patch ensures that small mask-type BUILD_VECTORs are always handled
without crashing. We lower to a SETCC of the equivalent i8 type.

This also exposes some pre-existing issues where the lowering when
optimizing for size results in larger code than without. Those will be
tackled in future patches.

Diff Detail

Event Timeline

frasercrmck created this revision.May 19 2021, 6:12 AM
frasercrmck requested review of this revision.May 19 2021, 6:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2021, 6:12 AM
This revision is now accepted and ready to land.May 20 2021, 11:13 AM