[PATCH] D151212: [RISCV][InsertVSETVLI] Support constant VLs larger than immediate encoding

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 07:16:39 PDT 2023


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

The immediate field on the vsetivli is fairly limited.  For larger vectors, we end up having to materialize a constant in a register.  We hadn't plumbed the infrastructure to treat such materialized constants as constants for purpose of vsetvli elimination.

I only bothered to handle LI.  We could extend this to LUI sequences, but well, 2048 elements is probably enough for all practical fixed length vector codegen.  :)

The test delta does point out a related problem.  At LMUL8, we see increased register allocation pressure, and we should probably either a) address register allocation remat, or b) be less aggressive about eliminating vsetvlis at high lmul.  Note that high LMUL code is not generated much by default.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151212

Files:
  llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-interleave.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-interleave.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-interleaved-access.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-masked-gather.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vand-vp.ll
  llvm/test/CodeGen/RISCV/rvv/shuffle-reverse.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151212.524697.patch
Type: text/x-patch
Size: 58199 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230523/4e7509c5/attachment-0001.bin>


More information about the llvm-commits mailing list