[llvm] [AArch64][Windows] Fix swift async context slot placement (PR #212922)
Saleem Abdulrasool via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 31 11:55:26 PDT 2026
================
@@ -0,0 +1,103 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
+; RUN: llc -mtriple=aarch64-unknown-windows-msvc -O2 < %s | FileCheck %s
+
+; The swift async context slot is allocated directly below the frame record. If
+; it is allocated above it instead, MachineFrameInfo's view of the callee-save
+; area disagrees with the prologue by 8 bytes, leaving a hole that PEI's stack
+; slot scavenger hands to a live local, which then shares an address with the
+; saved caller x29.
+;
+; The full frame layout is checked so that any object placed at or above the
+; frame record shows up here as a diff: x29 is saved at sp+88, the async context
+; sits below it at sp+80, and the spills land at sp+8 and sp+104.
+
+declare ptr @llvm.swift.async.context.addr() nounwind
+declare swiftcc void @swift_task_dealloc()
+
+define swifttailcc void @test(ptr %ctx, ptr %vw0, ptr %vw1, ptr %vw2, ptr %vw3, ptr %obj0, ptr %obj1, ptr %obj2, ptr %obj3, ptr %obj4) {
+; CHECK-LABEL: test:
----------------
compnerd wrote:
Yes, this is better.
https://github.com/llvm/llvm-project/pull/212922
More information about the llvm-commits
mailing list