This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Implement CFI for non-kernel functions
AbandonedPublic

Authored by scott.linder on Mar 26 2020, 12:21 PM.

Details

Summary

This does not implement CSR spills other than those AMDGPU handles
during PEI. The remaining spills are handled in a subsequent patch.

Diff Detail

Event Timeline

scott.linder created this revision.Mar 26 2020, 12:21 PM

git clang-format

arsenm added inline comments.Mar 26 2020, 1:42 PM
llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
666

Register

679

Double cast

692

MCPhysReg?

1056

Register

llvm/lib/Target/AMDGPU/SIFrameLowering.h
87

s/unsigned/Register

Rebase and address feedback.

scott.linder edited the summary of this revision. (Show Details)
scott.linder added a reviewer: cdevadas.
scott.linder added a subscriber: cdevadas.

Rebase, generalize the previously hard-coded list of caller-saved registers
with help from @cdevadas, and emit CFI for the new case where we spill the FP
to VMEM.

cdevadas added inline comments.May 13 2020, 6:28 AM
llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
30

I think it is good to move getAllSGPRs and getAllVGPRs into SIRegisterInfo.cpp.
There is another function getAllVGPR32 which does the same thing as getAllVGPRs.
We can unify these instances.

scott.linder marked an inline comment as done.
cdevadas added inline comments.May 14 2020, 9:06 AM
llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
1454

Can you write a small description of why the FIXME?

Rebase and emit CFI for Base pointer

Rebase onto LLVM master

Not my area of expertise but looks fine if the comments from others are addressed.

Rebase onto LLVM master and address feedback

Rebase onto LLVM trunk.

Rebase onto LLVM top of the tree.

Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 3:04 PM

Incorporated all the downstream changes.

arsenm accepted this revision.Sep 16 2022, 9:06 AM

LGTM. If there are remaining issues it's easier to fix later rather than continuing the routine pain of carrying this out of tree

This revision is now accepted and ready to land.Sep 16 2022, 9:06 AM
scott.linder abandoned this revision.Mar 30 2023, 3:40 PM

Abandoned in favor of D147279 which avoids using most/all of the remaining user opcode