This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][AIX] Set the HasAlloca flag in the AIX Traceback Table only if R31 is used as a frame pointer
ClosedPublic

Authored by ZarkoCA on Aug 16 2021, 9:12 AM.

Details

Summary

After c063946476e083a9a0c5bd397337d1ece4742ec6 usage of R31 doesn't necessarily mean
that alloca is used. The TracebackTable::IsAllocaUsedMask flag should be set only
when R31 is used as a frame pointer.

On AIX the `function calls alloca' bit seems to be set whenever R31 is
set up as a frame pointer, even when there is no alloca call.

Diff Detail

Unit TestsFailed

Event Timeline

ZarkoCA created this revision.Aug 16 2021, 9:12 AM
ZarkoCA requested review of this revision.Aug 16 2021, 9:12 AM

Is the AllocaUsed bit indicating LLVM instruction alloca is used? If so, I'm assuming this patches refers to dynamic alloca, since r31 is used under this condition. There is a flag in MachineFrameInfo::hasVarSizedObjects for dynamic alloca. There are some other cases also using r31 as frame pointer, so use r31 here might be not accurate.

Is the AllocaUsed bit indicating LLVM instruction alloca is used? If so, I'm assuming this patches refers to dynamic alloca, since r31 is used under this condition. There is a flag in MachineFrameInfo::hasVarSizedObjects for dynamic alloca. There are some other cases also using r31 as frame pointer, so use r31 here might be not accurate.

Yes, that's a good suggestion howeever, according to the AIX convention:

The `function calls alloca' bit seems to be set whenever reg 31 is
set up as a frame pointer, even when there is no alloca call.

And this is why we have this implementation. As per your good offline suggestion I will also edit the description of the patch to make this clear.

ZarkoCA edited the summary of this revision. (Show Details)Aug 19 2021, 9:30 AM
lkail accepted this revision.Aug 19 2021, 9:55 AM

LGTM, thanks.

This revision is now accepted and ready to land.Aug 19 2021, 9:55 AM
This revision was landed with ongoing or failed builds.Aug 23 2021, 12:20 PM
This revision was automatically updated to reflect the committed changes.