This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Handle register spill in BranchRelaxation pass
ClosedPublic

Authored by XiaodongLoong on Nov 11 2022, 2:10 AM.

Details

Summary

When the range of the unconditional branch is overflow, the indirect
branch way is used. The case when there is no scavenged register for
indirect branch needs to spill register to stack.

Diff Detail

Event Timeline

XiaodongLoong created this revision.Nov 11 2022, 2:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2022, 2:10 AM
XiaodongLoong requested review of this revision.Nov 11 2022, 2:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2022, 2:10 AM
SixWeining retitled this revision from Handle register spill in BranchRelaxation pass to [LoongArch] Handle register spill in BranchRelaxation pass.Nov 11 2022, 5:25 AM
SixWeining accepted this revision.Nov 13 2022, 10:29 PM

LGTM. But it's better to be reviewed by @wangleiat because I know he is also planning to add an another spill slot.

llvm/lib/Target/LoongArch/LoongArchFrameLowering.cpp
139

beyond?

This revision is now accepted and ready to land.Nov 13 2022, 10:29 PM

Improve comments.

XiaodongLoong marked an inline comment as done.Nov 14 2022, 5:42 PM
XiaodongLoong added inline comments.
llvm/lib/Target/LoongArch/LoongArchFrameLowering.cpp
139

I changed it. Thanks!

This revision was landed with ongoing or failed builds.Nov 14 2022, 5:56 PM
This revision was automatically updated to reflect the committed changes.
XiaodongLoong marked an inline comment as done.