This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add support for selecting vid.v from build_vector
ClosedPublic

Authored by frasercrmck on Feb 9 2021, 4:25 AM.

Details

Summary

This patch optimizes a build_vector "index sequence" and lowers it to
the existing custom RISCVISD::VID node. This pattern is common in
autovectorized code.

The custom node was updated to allow it to be used by both scalable and
fixed-length vectors, thus avoiding pattern duplication.

Diff Detail

Event Timeline

frasercrmck created this revision.Feb 9 2021, 4:25 AM
frasercrmck requested review of this revision.Feb 9 2021, 4:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2021, 4:25 AM

This was partly motivated to test the waters on how best to bring the fixed-length support up to speed with the scalable support. The main concern is obviously the number of patterns we'd introduce, and having more-or-less copy/pasted code. Adding the _VL seems to me like a reasonable approach for our existing custom nodes like VID, but what about for SETCC, INSERT_ELEMENT, etc? Should scalable- and fixed- nodes both be custom-lowered to a VL version?

This revision is now accepted and ready to land.Feb 9 2021, 11:15 AM
  • rebase
  • remove unused filechecks
This revision was landed with ongoing or failed builds.Feb 10 2021, 3:04 AM
This revision was automatically updated to reflect the committed changes.