Skip to content

[XCOFF] Do not generate the special .ref for zero-length sections #66805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

w2yehia
Copy link
Contributor

@w2yehia w2yehia commented Sep 19, 2023

No description provided.

@w2yehia
Copy link
Contributor Author

w2yehia commented Sep 19, 2023

tests will be added soon.
@hubert-reinterpretcast @daltenty FYI

Copy link
Member

@daltenty daltenty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any downside to loosing the refs in this case? (if there is maybe its better to pad the sections to make everything unambiguous?)

@w2yehia
Copy link
Contributor Author

w2yehia commented Sep 19, 2023

Is there any downside to loosing the refs in this case? (if there is maybe its better to pad the sections to make everything unambiguous?)

The refs were added specifically for PGO instrumentation sections (counters, data, names, value profiling nodes), and PGO instrumentation will not create zero-length objects. The case where we have zero-length objects sitting in PGO sections is the dummy zero-length variables manually added to the PGO runtime here. Not emitting the refs when compiling the PGO runtime source file will not impact functionality (as Hubert pointed out, offline, the __llvm_profile_keep array retains the dummy variables).

@daltenty
Copy link
Member

Looks fine to me once we have some tests

@w2yehia
Copy link
Contributor Author

w2yehia commented Sep 28, 2023

@daltenty tests added

@w2yehia w2yehia changed the title Do not generate the special .ref for zero-sized sections [XCOFF] Do not generate the special .ref for zero-sized sections Sep 28, 2023
@w2yehia w2yehia changed the title [XCOFF] Do not generate the special .ref for zero-sized sections [XCOFF] Do not generate the special .ref for zero-length sections Sep 28, 2023
@w2yehia w2yehia merged commit da55b1b into llvm:main Sep 28, 2023
@w2yehia w2yehia deleted the wyehia/llvm-17 branch September 28, 2023 05:36
tru pushed a commit that referenced this pull request Sep 29, 2023
legrosbuffle pushed a commit to legrosbuffle/llvm-project that referenced this pull request Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants