[PATCH] D148713: [LegalizeTypes][VP] Widen load/store of fixed length vectors to VP ops

Luke Lau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 06:30:55 PDT 2023


luke created this revision.
luke added reviewers: craig.topper, fakepaper56, frasercrmck.
Herald added subscribers: asb, pmatos, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya.
Herald added a project: All.
luke requested review of this revision.
Herald added subscribers: llvm-commits, alextsao1999, pcwang-thead, MaskRay.
Herald added a project: LLVM.

If we have a load/store with an illegal fixed length vector result type that
needs widened, e.g. `x:v6i32 = load p`
Instead of just widening it to: `x:v8i32 = load p`
We can widen it to the equivalent VP operation and set the EVL to the
exact number of elements needed: `x:v8i32 = vp_load a, b, mask=true, evl=6`
Provided that the target supports vp_load/vp_store on the widened type.

Scalable vectors are already widened this way where possible, so this
largely reuses the same logic.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148713

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-abs.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-extract.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp2i.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-i2fp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-insert.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-buildvec.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-interleaved-access.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-load.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-store.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vselect.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148713.514938.patch
Type: text/x-patch
Size: 159802 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230419/5175caa5/attachment-0001.bin>


More information about the llvm-commits mailing list