This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Teach vsetvli insertion to use vsetvl x0, x0 form when we can tell that VLMAX and AVL haven't changed.
ClosedPublic

Authored by craig.topper on May 26 2021, 4:44 PM.

Details

Summary

This can help avoid needing a virtual register for the vsetvl output
when the AVL is X0. For other register AVLs it can shorter the live
range of the AVL register if it isn't needed later.

There's probably no advantage when AVL is a 5 bit immediate that
can use vsetivli. But do it anyway for consistency.

Diff Detail

Event Timeline

craig.topper created this revision.May 26 2021, 4:44 PM
craig.topper requested review of this revision.May 26 2021, 4:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2021, 4:44 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
rogfer01 accepted this revision.May 27 2021, 5:06 AM

LGTM. Thanks!

This revision is now accepted and ready to land.May 27 2021, 5:06 AM