This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Override TargetFrameLowering::spillCalleeSavedRegisters
ClosedPublic

Authored by wangleiat on Nov 3 2022, 11:19 PM.

Details

Summary

When using llvm.returnaddress intrinsic, special handling is required
for the spill of the RA register. Otherwise it will cause the verifier
fail in some cases (e.g. pr17377.c of the GCC C Torture Suite).

Specifically:

*** Bad machine code: Using an undefined physical register ***
- function:    f
- basic block: %bb.0 entry (0xd94d18)
- instruction: ST_D killed $r1, $r22, -40 :: (store (s64) into %stack.2)
- operand 0:   killed $r1

Diff Detail

Event Timeline

wangleiat created this revision.Nov 3 2022, 11:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2022, 11:19 PM
wangleiat requested review of this revision.Nov 3 2022, 11:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2022, 11:19 PM
This revision is now accepted and ready to land.Nov 7 2022, 5:49 AM
This revision was landed with ongoing or failed builds.Nov 10 2022, 5:15 AM
This revision was automatically updated to reflect the committed changes.