This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Added spill/reload/copy support for CFRs
ClosedPublic

Authored by wangleiat on Oct 28 2022, 8:32 PM.

Details

Summary

1, spill/reload
When a function call is made immediately after a floating point
comparison, the result of the comparison needs to be spilled before
function call and reloaded after the function returns.

2, copy
Support GPR to CFR and CFR to GRP copys. Therefore, the correct
register class can be used in the pattern template, and the hard-coding
of mutual coping of CFR and GRP is eliminated, reducing redundant
comparison instructions.

Note: Since the COPY instruction between CFRs is not provided in
LoongArch, we only use $fcc0 in the register allocation.

Diff Detail

Event Timeline

wangleiat created this revision.Oct 28 2022, 8:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2022, 8:32 PM
wangleiat requested review of this revision.Oct 28 2022, 8:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2022, 8:32 PM
wangleiat updated this revision to Diff 473124.Nov 3 2022, 11:15 PM

rebase, For CFRs, only use fcc0.

wangleiat edited the summary of this revision. (Show Details)Nov 3 2022, 11:16 PM
SixWeining accepted this revision.Nov 7 2022, 5:47 AM

LGTM and wait others.

This revision is now accepted and ready to land.Nov 7 2022, 5:47 AM
wangleiat updated this revision to Diff 474501.Nov 10 2022, 4:12 AM
wangleiat edited the summary of this revision. (Show Details)

rebase

This revision was landed with ongoing or failed builds.Nov 10 2022, 4:21 AM
This revision was automatically updated to reflect the committed changes.