This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Improve splatPartsI64WithVL for fixed vector constants where Hi Lo are same and the VL is constant.
ClosedPublic

Authored by craig.topper on Aug 25 2023, 2:30 PM.

Details

Summary

If doubling the VL will fit in a vsetvli, use it. It will be cheap
to change and cheap to change back.

This improves codegen from D158896.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 25 2023, 2:30 PM
craig.topper requested review of this revision.Aug 25 2023, 2:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2023, 2:30 PM

LGTM

A few ideas for possible followups:

  • constants up to 11 bits, this is a single LI for the doubled form
  • preferring i8 splats if the 32 bit value is a 4 byte splat. This uses a smaller constant materialization sequence.
  • use vmseq for any single bit 64 bit constant
  • use all the vid tricks (and all other buildvector tricks, can we share code?)
  • for constants, use constant pool, not stack
reames accepted this revision.Aug 25 2023, 2:48 PM
This revision is now accepted and ready to land.Aug 25 2023, 2:48 PM
This revision was landed with ongoing or failed builds.Aug 29 2023, 9:28 AM
This revision was automatically updated to reflect the committed changes.