[PATCH] D97111: change rvv frame layout

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 22:22:03 PST 2021


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

This patch change the rvv frame layout that proposed in D94465 <https://reviews.llvm.org/D94465>. In patch D94465 <https://reviews.llvm.org/D94465>, In the eliminateFrameIndex function,
to eliminate the rvv frame index, create temp virtual register is needed. This virtual register should be scavenged by class
RegsiterScavenger. If the machine function has other unused registers, there is no problem. But if there isn't unused registers,
we need a emergency spill slot. Because of the emergency spill slot belongs to the scalar local variables field, to access emergency
spill slot, we need a temp virtual register again. This makes the compiler report the "Incomplete scavenging after 2nd pass" error.
So I change the rvv frame layout as follows:

  |--------------------------------------|
  |   arguments passed on the stack      |
  |--------------------------------------|<--- fp
  |   callee saved registers             |
  |--------------------------------------|
  |   rvv vector objects(local variables |
  |   and outgoing arguments             |
  |--------------------------------------|
  |   realignment field                  |
  |--------------------------------------|
  |   scalar local variable(also contains|
  |   emergency spill slot)              |
  |--------------------------------------|<--- bp
  |   variable-sized local variables     |
  |--------------------------------------|<--- sp


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97111

Files:
  llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
  llvm/lib/Target/RISCV/RISCVFrameLowering.h
  llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h
  llvm/test/CodeGen/RISCV/rvv/access-fixed-objects-by-rvv.ll
  llvm/test/CodeGen/RISCV/rvv/allocate-lmul-2-4-8.ll
  llvm/test/CodeGen/RISCV/rvv/localvar.ll
  llvm/test/CodeGen/RISCV/rvv/memory-args.ll
  llvm/test/CodeGen/RISCV/rvv/rv32-spill-vector-csr.ll
  llvm/test/CodeGen/RISCV/rvv/rv32-spill-vector.ll
  llvm/test/CodeGen/RISCV/rvv/rv64-spill-vector-csr.ll
  llvm/test/CodeGen/RISCV/rvv/rv64-spill-vector.ll
  llvm/test/CodeGen/RISCV/saverestore.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97111.325159.patch
Type: text/x-patch
Size: 91845 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210220/a8ccf547/attachment.bin>


More information about the llvm-commits mailing list