This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Improve splatPartsI64WithVL for vlmax scalable vector constants where Hi and Lo are the same.
ClosedPublic

Authored by craig.topper on Aug 25 2023, 12:39 PM.

Details

Summary

We can use a 32-bit splat and bitcast to i64 vector.

This only handles the case where we are using vlmax so that the new
vl is cheap to compute. This could be generalized to double the VL.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 25 2023, 12:39 PM
craig.topper requested review of this revision.Aug 25 2023, 12:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2023, 12:39 PM
reames accepted this revision.Aug 25 2023, 1:00 PM

LGTM

As I follow up, I'd be really tempted to just double the VL. At a minimum, doing so for constants encodable in vsetivli seems like a clear win.

This revision is now accepted and ready to land.Aug 25 2023, 1:00 PM

LGTM

As I follow up, I'd be really tempted to just double the VL. At a minimum, doing so for constants encodable in vsetivli seems like a clear win.

Yep that's exactly the change that's needed to improve the output of D158870. We have to be careful so that doubling doesn't turn something like 0x80000000 into 0. So constants are a lot easier than arbitrary VL.

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