[all-commits] [llvm/llvm-project] d8e8ab: [AArch64][SME] Fix restoring callee-saves from FP ...

Benjamin Maxwell via All-commits all-commits at lists.llvm.org
Wed Jun 18 04:58:38 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d8e8ab79773f739c602c5869f80c6c5b5962c558
      https://github.com/llvm/llvm-project/commit/d8e8ab79773f739c602c5869f80c6c5b5962c558
  Author: Benjamin Maxwell <benjamin.maxwell at arm.com>
  Date:   2025-06-18 (Wed, 18 Jun 2025)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
    M llvm/test/CodeGen/AArch64/stack-hazard.ll

  Log Message:
  -----------
  [AArch64][SME] Fix restoring callee-saves from FP with hazard padding (#143371)

Currently, when hazard-padding is enabled a (fixed-size) hazard slot is
placed in the CS area, just after the frame record. The size of this
slot is part of the "CalleeSaveBaseToFrameRecordOffset". The SVE
epilogue emission code assumed this offset was always zero, and
incorrectly setting the stack pointer, resulting in all SVE registers
being reloaded from incorrect offsets.

```
| prev_lr                           |
| prev_fp                           |
| (a.k.a. "frame record")           |
|-----------------------------------| <- fp(=x29)
|   <hazard padding>                |
|-----------------------------------| <- callee-saved base
|                                   |
| callee-saved fp/simd/SVE regs     |
|                                   |
|-----------------------------------| <- SVE callee-save base
```

i.e. in the above diagram, the code assumed `fp == callee-saved base`.



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