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

Benjamin Maxwell via All-commits all-commits at lists.llvm.org
Tue Jul 8 11:32:24 PDT 2025


  Branch: refs/heads/release/20.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 0c9f909b7976dc4a1643bf708484dc63725ecb21
      https://github.com/llvm/llvm-project/commit/0c9f909b7976dc4a1643bf708484dc63725ecb21
  Author: Benjamin Maxwell <benjamin.maxwell at arm.com>
  Date:   2025-07-08 (Tue, 08 Jul 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