[PATCH] D155792: [Statepoint] Use correct RegisterClass for spilling
Danila Malyutin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 20 06:00:15 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe1aa4e7b383e: [Statepoint] Use correct RegisterClass for spilling (authored by danilaml).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155792/new/
https://reviews.llvm.org/D155792
Files:
llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp
llvm/test/CodeGen/AArch64/aarch64-fixup-statepoint-regs-crash.ll
Index: llvm/test/CodeGen/AArch64/aarch64-fixup-statepoint-regs-crash.ll
===================================================================
--- llvm/test/CodeGen/AArch64/aarch64-fixup-statepoint-regs-crash.ll
+++ llvm/test/CodeGen/AArch64/aarch64-fixup-statepoint-regs-crash.ll
@@ -1,8 +1,27 @@
-; XFAIL: *
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --extra_scrub --version 3
; REQUIRES: asserts
-; RUN: llc -verify-machineinstrs -max-registers-for-gc-values=256 -mtriple=aarch64-none-linux-gnu < %s
+; RUN: llc -verify-machineinstrs -max-registers-for-gc-values=256 -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s
+; Verify that FixupStatepointCallerSaved pass uses correct intruction for spilling a register after copyprop
define dso_local ptr addrspace(1) @foo(ptr addrspace(1) %arg) gc "statepoint-example" personality ptr null {
+; CHECK-LABEL: foo:
+; CHECK: .Lfunc_begin0:
+; CHECK-NEXT: .cfi_startproc
+; CHECK-NEXT: // %bb.0:
+; CHECK-NEXT: sub sp, sp, #48
+; CHECK-NEXT: stp x30, x19, [sp, #32] // 16-byte Folded Spill
+; CHECK-NEXT: .cfi_def_cfa_offset 48
+; CHECK-NEXT: .cfi_offset w19, -8
+; CHECK-NEXT: .cfi_offset w30, -16
+; CHECK-NEXT: ldr q0, [x0]
+; CHECK-NEXT: str d0, [sp, #8] // 8-byte Folded Spill
+; CHECK-NEXT: str q0, [sp, #16]
+; CHECK-NEXT: bl baz // 8-byte Folded Reload
+; CHECK-NEXT: .Ltmp0:
+; CHECK-NEXT: ldp x19, x0, [sp, #8] // 8-byte Folded Reload
+; CHECK-NEXT: ldp x30, x19, [sp, #32] // 16-byte Folded Reload
+; CHECK-NEXT: add sp, sp, #48
+; CHECK-NEXT: ret
%load = load <2 x ptr addrspace(1)>, ptr addrspace(1) %arg, align 8
%extractelement = extractelement <2 x ptr addrspace(1)> %load, i64 0
%call = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr nonnull elementtype(void ()) @baz, i32 0, i32 0, i32 0, i32 0) [ "deopt"(ptr addrspace(1) %extractelement), "gc-live"(<2 x ptr addrspace(1)> %load) ]
Index: llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp
===================================================================
--- llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp
+++ llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp
@@ -407,7 +407,6 @@
void spillRegisters() {
for (Register Reg : RegsToSpill) {
int FI = CacheFI.getFrameIndex(Reg, EHPad);
- const TargetRegisterClass *RC = TRI.getMinimalPhysRegClass(Reg);
NumSpilledRegisters++;
RegToSlotIdx[Reg] = FI;
@@ -419,6 +418,7 @@
bool IsKill = true;
MachineBasicBlock::iterator InsertBefore(MI);
Reg = performCopyPropagation(Reg, InsertBefore, IsKill, TII, TRI);
+ const TargetRegisterClass *RC = TRI.getMinimalPhysRegClass(Reg);
LLVM_DEBUG(dbgs() << "Insert spill before " << *InsertBefore);
TII.storeRegToStackSlot(*MI.getParent(), InsertBefore, Reg, IsKill, FI,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155792.542472.patch
Type: text/x-patch
Size: 2908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230720/b5767f11/attachment-0001.bin>
More information about the llvm-commits
mailing list