This is an archive of the discontinued LLVM Phabricator instance.

[MC][ELF] Introduce .rodata.cold section
AbandonedPublic

Authored by Amir on May 11 2021, 5:00 PM.

Details

Summary

Introduce .rodata.cold section that is used for infrequently accessed
data to improve cache utilization.

Background: BOLT performs an optimization of moving unused jump tables
to .rodata.cold section. More details are here:
BOLT

Diff Detail

Event Timeline

Amir created this revision.May 11 2021, 5:00 PM
Amir published this revision for review.May 11 2021, 6:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2021, 6:09 PM
Amir retitled this revision from [MC] Add .rodata.cold section to [MC][ELF] Introduce .rodata.cold section.Jun 4 2021, 11:13 PM
Amir edited the summary of this revision. (Show Details)
Amir added a reviewer: MaskRay.
MaskRay requested changes to this revision.EditedJun 5 2021, 4:10 PM

The default section variables are there because they are referenced in many places internally.
I don't see that .rodata.cold needs to be a built-in default section. The application can call Ctx->getELFSection(".rodata.cold", ELF::SHT_PROGBITS, ELF::SHF_ALLOC); instead.

This revision now requires changes to proceed.Jun 5 2021, 4:10 PM
Amir abandoned this revision.Jun 5 2021, 8:04 PM

@MaskRay: makes sense. Will just use MCObjectFileInfo->getContext()... interface since we're only using in a single place.