[all-commits] [llvm/llvm-project] 7be2ce: [RISCV] fix SP recovery in a function epilogue (#1...

dlav-sc via All-commits all-commits at lists.llvm.org
Fri Oct 4 02:22:32 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7be2ce7312191894c2458ecc08de7683fd2314fb
      https://github.com/llvm/llvm-project/commit/7be2ce7312191894c2458ecc08de7683fd2314fb
  Author: dlav-sc <daniil.avdeev at syntacore.com>
  Date:   2024-10-04 (Fri, 04 Oct 2024)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
    M llvm/lib/Target/RISCV/RISCVFrameLowering.h
    M llvm/test/CodeGen/RISCV/branch-relaxation.ll
    M llvm/test/CodeGen/RISCV/out-of-reach-emergency-slot.mir
    M llvm/test/CodeGen/RISCV/rvv/addi-scalable-offset.mir
    M llvm/test/CodeGen/RISCV/rvv/callee-saved-regs.ll
    M llvm/test/CodeGen/RISCV/rvv/emergency-slot.mir
    M llvm/test/CodeGen/RISCV/rvv/large-rvv-stack-size.mir
    M llvm/test/CodeGen/RISCV/stack-realignment.ll

  Log Message:
  -----------
  [RISCV] fix SP recovery in a function epilogue (#110809)

Currently, in the cases when fp register is presented and sp register is
adjusted at the second time, sp recovery in a function epilogue isn't
performed in the best way, for example:
```
lui a0, 2
sub sp, s0, a0
addi a0, a0, -2044
add sp, sp, a0
```

This patch improves sp register recovery in such cases and the code
snippet above becomes:
```
addi sp, s0, -2044
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list