Page MenuHomePhabricator

[PowerPC][AIX] Fix frame-pointer and base-pointer save/restore offset.
ClosedPublic

Authored by sfertile on Aug 12 2020, 11:42 AM.

Details

Summary

gprs 30 and 31 are handled differently when they are reserved as the base-pointer and frame-pointer respectively. This fixes the offset of their fixed-stack objects when there are fpr calle-saved registers.

Diff Detail

Event Timeline

sfertile created this revision.Aug 12 2020, 11:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2020, 11:42 AM
sfertile requested review of this revision.Aug 12 2020, 11:42 AM
Xiangling_L added inline comments.Aug 14 2020, 8:31 AM
llvm/test/CodeGen/PowerPC/aix-framepointer-save-restore.ll
3

Since you have a variable n here, I believe we've already had some testcases making sure frame pointer will definitely be used in this scenario, you can remove -frame-pointer=all. But I am okay if you want to keep it just in case. And if so, should we also add on for below 64bit case?

ZarkoCA added inline comments.Aug 14 2020, 10:14 AM
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
1545–1546

I'm pretty sure this variable is no longer needed.

llvm/test/CodeGen/PowerPC/aix-base-pointer.ll
13

Just a question: is this test maybe good to have as it is to show behaviour for a void return?

sfertile updated this revision to Diff 287432.Aug 24 2020, 10:12 AM
  • Removed now unused local variable.
  • Removed -framepointer=all option in lit test.
  • Fixed formatting of runsteps in new lit test.
sfertile added inline comments.Aug 24 2020, 10:14 AM
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
1545–1546

You are right, good catch.

llvm/test/CodeGen/PowerPC/aix-base-pointer.ll
13

I could have both a void return and a float return versions in the test, but I'm not sure its really worth the bother.

llvm/test/CodeGen/PowerPC/aix-framepointer-save-restore.ll
3

Good point. I removed it from the 64 bit run step but missed this one.

ZarkoCA accepted this revision.Aug 31 2020, 7:34 AM

Looks good with minor nit.

llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
1545–1546

It looks like this causes a build failure with Werror on.

llvm/test/CodeGen/PowerPC/aix-framepointer-save-restore.ll
3

nit: can the indentation be lined up?

6

same as above

This revision is now accepted and ready to land.Aug 31 2020, 7:34 AM
Xiangling_L added inline comments.Aug 31 2020, 8:44 AM
llvm/test/CodeGen/PowerPC/aix-framepointer-save-restore.ll
3

As a reference, external reviewers used to point out the proper way to arrange the testcase command line here:
https://reviews.llvm.org/D78929#inline-740137