[PATCH] D106601: [RISCV] Teach vsetvli insertion pass that it doesn't need to insert vsetvli for unit strided stores in some cases.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 14:51:24 PDT 2021


craig.topper created this revision.
craig.topper added reviewers: frasercrmck, rogfer01, khchen, HsiangKai, arcbbb, evandro.
Herald added subscribers: StephenFan, vkmr, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
craig.topper requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.

For unit-stride loads we set the SEW operand of the pseudo
instruction equal the EEW in the opcode. And the LMUL of the
pseudo instruction is the LMUL we want.

These instructions calculate EMUL=(EEW/SEW) * LMUL. We can use
this to avoid changing vtype if the SEW/LMUL of the previous
vtype matches the EEW/EMUL ratio we need for the instruction.

Due to how the global analysis works, we can only do this
optimization when the previous vsetvli was produced in the block
containing the store. We need to know in the first phase if the
vsetvli will be inserted so we can propagate information to
the successors in the second phase correctly. This means we can't
depend on predecessors.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106601

Files:
  llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-conv.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp2i.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106601.360986.patch
Type: text/x-patch
Size: 10376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210722/a4f4e806/attachment-0001.bin>


More information about the llvm-commits mailing list