[PATCH] D138007: [LoongArch] Add emergency spill slot for CFR spill/reload

wanglei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 15 00:07:57 PST 2022


wangleiat created this revision.
wangleiat added reviewers: SixWeining, xen0n, xry111, gonglingqin, XiaodongLoong, MaskRay.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
wangleiat requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When all registers have been allocated and CFR needs to be saved on the
stack, an emergency spill slot is required. Because CFR's spill and
reload require a general purpose register to transfer.

The attached test case was bugpoint-reduced down from
`MultiSource/Benchmarks/mafft/Lalignmm.c` in the test-suite.
Without this patch, llc will crash and report the following errors:

  LLVM ERROR: Error while trying to spill R4 from class GPR: Cannot scavenge register without an emergency spill slot!


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138007

Files:
  llvm/lib/Target/LoongArch/LoongArchFrameLowering.cpp
  llvm/test/CodeGen/LoongArch/mafft-Lalignmm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138007.475356.patch
Type: text/x-patch
Size: 10333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221115/f23f7dfc/attachment.bin>


More information about the llvm-commits mailing list