This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Further optimize BUILD_VECTORs with repeated elements
ClosedPublic

Authored by frasercrmck on Mar 19 2021, 10:51 AM.

Details

Summary

This patch builds upon the initial BUILD_VECTOR work introduced in
D98700. It further optimizes the lowering of BUILD_VECTOR by using
VSELECT operations to effectively insert repeated elements into the
vector with relatively few instructions. This allows us to optimize more
BUILD_VECTORs without significantly increasing the size of the generated
code.

Diff Detail

Event Timeline

frasercrmck created this revision.Mar 19 2021, 10:51 AM
frasercrmck requested review of this revision.Mar 19 2021, 10:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2021, 10:51 AM
craig.topper accepted this revision.Mar 22 2021, 11:42 AM

LGTM other than that one comment.

llvm/lib/Target/RISCV/RISCVISelLowering.cpp
1291

Put this block in curly braces for consistency with the else?

This revision is now accepted and ready to land.Mar 22 2021, 11:42 AM
frasercrmck marked an inline comment as done.
  • rebase
  • address feedback
  • update tests
frasercrmck added inline comments.Mar 23 2021, 3:39 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
1291

Aye thanks, I prefer it consistent. I wasn't sure what the style guidelines are for that situation.