[all-commits] [llvm/llvm-project] 80fd9f: [CSKY] Fix error of underestimated function size b...

Zi Xuan Wu (Zeson) via All-commits all-commits at lists.llvm.org
Tue May 31 20:23:04 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 80fd9f3e0a185fb285a9b597e020d60bb5dfb9a2
      https://github.com/llvm/llvm-project/commit/80fd9f3e0a185fb285a9b597e020d60bb5dfb9a2
  Author: Zi Xuan Wu (Zeson) <zixuan.wu at linux.alibaba.com>
  Date:   2022-06-01 (Wed, 01 Jun 2022)

  Changed paths:
    M llvm/lib/Target/CSKY/CSKYFrameLowering.cpp

  Log Message:
  -----------
  [CSKY] Fix error of underestimated function size by save/restore R15(LR) when we use BSR far jump.

In CSKYConstantIslands, when fix up an unconditional branch(CSKY::BR32) whose destination is
too far away to fit in its displacement field, and if the R15(LR) register has been
spilled in the prologue, then we can use BSR to implement a far jump. So we need estimate function
size, and spill R15(LR) when the function size >= unconditional branch(CSKY::BR32) can reach.

EstimateFunctionSizeInBytes function adds up all instructions and constant pool entries(each entry is 4 bytes).




More information about the All-commits mailing list