[all-commits] [llvm/llvm-project] 71b5f5: [RISCV] Adjust first sp size to use c.addi16sp.

Jie Fu (傅杰) via All-commits all-commits at lists.llvm.org
Tue Sep 5 23:32:35 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 71b5f57f0d7dfd79211f09d53f2baaaa205984a2
      https://github.com/llvm/llvm-project/commit/71b5f57f0d7dfd79211f09d53f2baaaa205984a2
  Author: laichunfeng <laichunfeng at tencent.com>
  Date:   2023-09-06 (Wed, 06 Sep 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
    M llvm/test/CodeGen/RISCV/stack-inst-compress.mir

  Log Message:
  -----------
  [RISCV] Adjust first sp size to use c.addi16sp.

addi sp, sp, 512 may be used to recover the sp in the epilogue
when stack size is larger than 2047(2^11 - 1), however, it can
not be compressed using C extension, and addi sp, sp, 496 is
able to be compressed, so try to use 496 as the ajust amount of
the fisrt sp if function doesn't need extra instructions after
adjust.

Reviewed By: wangpc

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




More information about the All-commits mailing list