This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Teach VSETVLI inserter to use VSETIVLI when possible.
ClosedPublic

Authored by craig.topper on Feb 23 2021, 1:26 PM.

Details

Summary

We always create the VL operand using a register, but if we can
determine that it came from an ADDI X0, imm with a sufficiently
small immediate, we can use VSETIVLI.

Diff Detail

Event Timeline

craig.topper created this revision.Feb 23 2021, 1:26 PM
craig.topper requested review of this revision.Feb 23 2021, 1:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2021, 1:26 PM
Herald added a subscriber: MaskRay. · View Herald Transcript

It's my understanding that the meaning of 0 could change at some point but I think we can come to that if and when the time comes.

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

This could now be addReg(VLReg)?

Rebase and address review comment

frasercrmck accepted this revision.Feb 24 2021, 2:20 PM

LGTM. I was looking forward to this!

This revision is now accepted and ready to land.Feb 24 2021, 2:20 PM