[all-commits] [llvm/llvm-project] 4ae222: [RISCV] Add a test case to show the bug in RISCVFr...

Kai Wang via All-commits all-commits at lists.llvm.org
Mon Nov 29 18:40:18 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ae2222e143b8541b6567f9852d9600a17cc9426
      https://github.com/llvm/llvm-project/commit/4ae2222e143b8541b6567f9852d9600a17cc9426
  Author: Hsiangkai Wang <kai.wang at sifive.com>
  Date:   2021-11-30 (Tue, 30 Nov 2021)

  Changed paths:
    A llvm/test/CodeGen/RISCV/rvv/no-reserved-frame.ll

  Log Message:
  -----------
  [RISCV] Add a test case to show the bug in RISCVFrameLowering.

If the number of arguments is too large to use register passing, it
needs to occupy stack space to pass the arguments to the callee. There
are two scenarios. One is to reserve the space in prologue and the other
is to reserve the space before the function calls. When we need to
reserve the stack space before function calls, the stack pointer is
adjusted. Under the scenario, we should not use stack pointer to access
the stack objects. It looks like,

callseq_start  ->  sp = sp - reserved_space
//
// We should not use SP to access stack objects in this area.
//
call @foo
callseq_end    ->  sp = sp + reserved_space

Differential Revision: https://reviews.llvm.org/D114245


  Commit: 9a88566537177df75af1fcde69e0626fed2b1145
      https://github.com/llvm/llvm-project/commit/9a88566537177df75af1fcde69e0626fed2b1145
  Author: Hsiangkai Wang <kai.wang at sifive.com>
  Date:   2021-11-30 (Tue, 30 Nov 2021)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
    M llvm/test/CodeGen/RISCV/rvv/no-reserved-frame.ll

  Log Message:
  -----------
  [RISCV] Fix a bug in RISCVFrameLowering.

When we have out-going arguments passing through stack and we do not
reserve the stack space in the prologue. Use BP to access stack objects
after adjusting the stack pointer before function calls.

callseq_start  ->  sp = sp - reserved_space
//
// Use FP to access fixed stack objects.
// Use BP to access non-fixed stack objects.
//
call @foo
callseq_end    ->  sp = sp + reserved_space

Differential Revision: https://reviews.llvm.org/D114246


Compare: https://github.com/llvm/llvm-project/compare/fde937748b7d...9a8856653717


More information about the All-commits mailing list