This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Use vmv.s.x for a constant build_vector when the entire size is less than 32 bits
ClosedPublic

Authored by reames on Aug 7 2023, 10:19 AM.

Details

Summary

We have a variant of this for splats already, but hadn't handled the case where a single copy of the wider element can be inserted producing the entire required bit pattern. This shows up mostly in very small vector shuffle tests.

Diff Detail

Event Timeline

reames created this revision.Aug 7 2023, 10:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 10:19 AM
reames requested review of this revision.Aug 7 2023, 10:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 10:19 AM
luke added inline comments.Aug 7 2023, 10:37 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
3301

Are EltIdx and Idx the same?

reames added inline comments.Aug 7 2023, 12:28 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
3301

Looks like it. Will fix.

luke accepted this revision.Aug 7 2023, 12:31 PM

LGTM

This revision is now accepted and ready to land.Aug 7 2023, 12:31 PM
reames updated this revision to Diff 547918.Aug 7 2023, 12:42 PM

Address review comment

This revision was landed with ongoing or failed builds.Aug 7 2023, 5:15 PM
This revision was automatically updated to reflect the committed changes.