[PATCH] D43752: [RISCV] Preserve stack space for outgoing arguments when the function contain variable size objects

Shiva Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 00:19:27 PST 2018


shiva0217 created this revision.
shiva0217 added a reviewer: asb.
Herald added subscribers: kito-cheng, niosHD, sabuasal, apazos, jordy.potman.lists, simoncook, johnrusso, rbar.

When the function contains variable size objects:
E.g.

bar (int x)
{

  char p[x];
  
  push outgoing variables for foo.
  call foo

}

RISCVFrameLowering::hasFP() will return true.
Therefore, default hasReservedCallFrame will return false which means outgoing arguments stack space will not preserve.

We need to generate stack adjustment instructions for outgoing arguments by eliminateCallFramePseudoInstr when the function contains variable size objects.


Repository:
  rL LLVM

https://reviews.llvm.org/D43752

Files:
  lib/Target/RISCV/RISCVFrameLowering.cpp
  lib/Target/RISCV/RISCVFrameLowering.h
  test/CodeGen/RISCV/alloca.ll
  test/CodeGen/RISCV/calling-conv.ll
  test/CodeGen/RISCV/vararg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43752.135855.patch
Type: text/x-patch
Size: 8364 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180226/9aa59265/attachment.bin>


More information about the llvm-commits mailing list