Page MenuHomePhabricator

[StackMaps] Force section serialization for functions with no records
Changes PlannedPublic

Authored by yrouban on Tue, Jun 8, 4:15 AM.

Details

Summary

This patch allows to get function frame size from the .llvm_stackmaps section.
This section was generated for those functions that have at least one stack map record. For the other functions we could not get frame size. (The .eh_frame section does not help. Any other way?).

The StackMap class collected functions when stack map records were added. This patch introduces method StackMap::registerFunction() that is called before adding stack map records. All registered functions will have records with their frame sizes in the stack map section if the new option -stackmap-force-serialization is set to true even if there is no stack map records. With -stackmap-force-serialization set to false (the default) the old behavior is used: only those functions that have at least one record get into the stack map section and the section is generated only if there is at least one such function.

Diff Detail

Event Timeline

yrouban created this revision.Tue, Jun 8, 4:15 AM
yrouban requested review of this revision.Tue, Jun 8, 4:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptTue, Jun 8, 4:15 AM
yrouban updated this revision to Diff 351052.Wed, Jun 9, 8:50 PM

fixed nits reported by build bots

I don't really have an objection to this, but have you looked at the -stack-size-section support? I think you might be able to get the same information that way. If that doesn't work for some reason, just let me know and we can move forward with the review of this.

yrouban planned changes to this revision.Fri, Jun 18, 3:54 AM

I don't really have an objection to this, but have you looked at the -stack-size-section support? I think you might be able to get the same information that way. If that doesn't work for some reason, just let me know and we can move forward with the review of this.

Thank you, Philip. The .stack_sizes section seems to be exactly what we need.

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
1661

must call the base PPCAsmPrinter::emitFunctionBodyStart(); to register the function in StackMaps.

llvm/test/CodeGen/AArch64/stackmap.ll
63

remove extra '_' in the name