[PATCH] D122769: [RISCV] Add a prepass to vsetvli insertion to propagate VLMAX vsetvli to the instructions.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 16:05:18 PDT 2022


craig.topper created this revision.
craig.topper added reviewers: frasercrmck, rogfer01, loralb.
Herald added subscribers: sunshaoce, VincentWu, luke957, StephenFan, vkmr, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, edward-jones, zzheng, jrtc27, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

If the VL value for a vector instruction comes from a vsetvli for
VLMAX and the SEW/LMUL ratio matches, we can replace the VL on the
instruction with X0. This allows all the vsetvlis generated for the
instruction to use VLMAX vsetvlis. Or it can prevent vsetvli
instructions from being generated in loops.

This is based on a test case rogfer01 sent me a while back. We could
propagate any AVL, but looking at some of the test changes for that
I'm not sure it makes sense. So I've restricted to just the VLMAX case.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122769

Files:
  llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
  llvm/test/CodeGen/RISCV/rvv/vsetvli-insert-crossbb.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122769.419283.patch
Type: text/x-patch
Size: 5929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220330/b0768e47/attachment.bin>


More information about the llvm-commits mailing list