This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][InsertVSETVLI] Mutate prior vsetvli AVL if doing so allows us to remove a toggle
ClosedPublic

Authored by reames on Dec 14 2022, 1:01 PM.

Details

Summary

This extends the backwards walk to allow mutating the previous vsetvl's AVL value if it was not used by any instructions in between. In practice, this mostly benefits vmv.x.s and fvmv.f.s patterns since vector instructions which ignore VL are rare.

Diff Detail

Event Timeline

reames created this revision.Dec 14 2022, 1:01 PM
reames requested review of this revision.Dec 14 2022, 1:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 1:01 PM
craig.topper accepted this revision.Dec 14 2022, 3:32 PM

LGTM

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
1204

later -> latter

This revision is now accepted and ready to land.Dec 14 2022, 3:32 PM
This revision was landed with ongoing or failed builds.Dec 15 2022, 7:33 AM
This revision was automatically updated to reflect the committed changes.

We just pulled this into our downstream and we’re seeing a vsetvli getting its register changed to an immediate without changing the opcode to vsetivli.