Skip to content

Conversation

@nikic
Copy link
Contributor

@nikic nikic commented Mar 4, 2024

This contains two updates:

  • Generalize the "no loads stores of aggregates" to "no values of aggregate type" in general, and be clearer about the exceptions where it is okay to use them.
  • Mention that you should not load/store non-byte-size types.

@nikic nikic requested review from fhahn and preames March 4, 2024 11:54
@nikic nikic changed the title Update frontend perfomance tips about loads/stores [Docs] Update frontend perfomance tips about loads/stores Mar 4, 2024
they are commonly used in ``getelementptr`` instructions or attributes like
``sret``.

Avoid loads and stores of non-byte-sized types
Copy link
Contributor

Choose a reason for hiding this comment

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

Is "non-byte-sized" a standard term? I first thought it means "types of a size that is not exactly one byte". But I'm also not super familiar with standard LLVM terminology.

The text inside this section makes it clear enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's a pretty common term. In the backend we use isByteSized, in the middle-end typeSizeEqualsStoreSize to query these.

Copy link
Collaborator

@preames preames left a comment

Choose a reason for hiding this comment

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

LGTM

@nikic nikic merged commit ff66e9b into llvm:main Mar 5, 2024
@nikic nikic deleted the perf-tips-update branch March 5, 2024 08:34
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.

3 participants