This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Add emergency spill slot for CFR spill/reload
ClosedPublic

Authored by wangleiat on Nov 15 2022, 12:07 AM.

Details

Summary

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!

Diff Detail

Event Timeline

wangleiat created this revision.Nov 15 2022, 12:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2022, 12:07 AM
wangleiat requested review of this revision.Nov 15 2022, 12:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2022, 12:07 AM

Delete redundant CHECK

This revision is now accepted and ready to land.Nov 16 2022, 8:11 PM
This revision was landed with ongoing or failed builds.Nov 18 2022, 10:53 PM
This revision was automatically updated to reflect the committed changes.