This is an archive of the discontinued LLVM Phabricator instance.

[AIX][PowerPC][PGO] Generate .ref for some PGO sections
ClosedPublic

Authored by w2yehia on Jan 4 2022, 10:52 AM.

Details

Summary

For PGO on AIX, when we switch to the linux-style PGO variable access (via _start and _stop labels), we need the compiler to generate a .ref assembly for each of the three csects:

  • __llvm_prf_data[RW]
  • __llvm_prf_names[RO]
  • __llvm_prf_vnds[RW]

We insert the .ref inside the __llvm_prf_cnts[RW] csect so that if it's live then the 3 csects are live.

For example, for a testcase with at least one function definition, when compiled with -fprofile-generate we should generate:

.csect __llvm_prf_cnts[RW],3
.ref __llvm_prf_data[RW]   <<============ needs to be inserted
.ref __llvm_prf_names[RO]  <<===========

the __llvm_prf_vnds is not always present, so we reference it only when it's present.

Diff Detail

Unit TestsFailed

Event Timeline

w2yehia created this revision.Jan 4 2022, 10:52 AM
w2yehia requested review of this revision.Jan 4 2022, 10:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2022, 10:52 AM
w2yehia edited the summary of this revision. (Show Details)Jan 4 2022, 10:53 AM
w2yehia added reviewers: sfertile, daltenty.
w2yehia updated this revision to Diff 397605.Jan 5 2022, 8:51 AM

clang-format

jsji added a reviewer: Restricted Project.Jan 5 2022, 8:52 AM
sfertile accepted this revision as: sfertile.Jan 27 2022, 6:43 PM

LGTM Wael. Sorry for taking so long to get to it.

This revision is now accepted and ready to land.Jan 27 2022, 6:43 PM
This revision was landed with ongoing or failed builds.Feb 5 2022, 4:04 AM
This revision was automatically updated to reflect the committed changes.