This is an archive of the discontinued LLVM Phabricator instance.

[llvm][XCOFF] Don't seperate mergable strings by alignment
AbandonedPublic

Authored by daltenty on Feb 27 2023, 7:55 AM.

Details

Summary

Currently when we place mergable strings into a csect, we generate the name according to the size and alignment, which is something
we inherited from the ELF backend, which merges the strings in compatible sections.

However, for XCOFF, this causes problems (as seen in https://reviews.llvm.org/D134282) if a late CodeGen pass tries to update the
alignment of the global, as we emit relocations directly to this section for XCOFF. To avoid this situation and simplify things, this
change drops the alignment from the identifier, since it doesn't really serve a purpose without the accompanying linker feature.

Diff Detail

Event Timeline

daltenty created this revision.Feb 27 2023, 7:55 AM
Herald added a reviewer: MaskRay. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
daltenty requested review of this revision.Feb 27 2023, 7:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2023, 7:55 AM
daltenty planned changes to this revision.Feb 28 2023, 3:00 PM

It seems there's actually some work going on at the present time to re-work how constant data like this is structured in the XCOFF codegen (e.g. to do some pooling). This patch is likely to conflict and/or be superseded by that approach, so I'm going to put this on hold for the moment till that refactoring lands and we see whether this is still relevant.

daltenty abandoned this revision.May 16 2023, 6:35 AM