GO-V.ORG
As seen in

Load-Hit-Store

A Load-Hit-Store, sometimes abbreviated as LHS, is a data dependency in a CPU in which a memory location that has just been the target of a store operation is loaded from.[src] The CPU may then need to wait until the store finishes, so that the correct value can be retrieved.[src] This involves e.g.[src] a L1 cache roundtrip, during which most or all of the pipeline will be stalled, causing a significant decrease in performance.[src] For example, (C/C++): int slow(int *a, int *b) { *a = 5; *b = 7; return *a + *b; } Here, the language rules do not allow the compiler to assume that the pointers a and b refer to different memory locations.[src] Therefore, it cannot, in general, keep the stored values in a register for the final addition (or, in this simple example, precalculate the return value to 12), but instead has to emit code that reloads at least the value from the first memory location, *a .[src] The only realistic alternatives are a test-and-branch to see whether a and b are equal, in which case the correct return value is 14, but this adds significant overhead if the pointers are not equal, and optimizations enabled by function inlining.[src] Now if a call to slow is made with the same address for a and b , there is a data dependency between the memory stores and the memory load(s) in the final statement of slow .…[src]

A Load-Hit-Store, sometimes abbreviated as LHS, is a data dependency in a CPU in which a memory location that has just been the target of a store operation is loaded from.[src] The CPU may then need to wait until the store finishes, so that the correct value can be retrieved.[src] This involves e.g.[src] a L1 cache roundtrip, during which most or all of the pipeline will be stalled, causing a significant decrease in performance.[src] For example, (C/C++): int slow(int *a, int *b) { *a = 5; *b = 7; return *a + *b; } Here, the language rules do not allow the compiler to assume that the pointers a and b refer to different memory locations.[src] Therefore, it cannot, in general, keep the stored values in a register for the final addition (or, in this simple example, precalculate the return value to 12), but instead has to emit code that reloads at least the value from the first memory location, *a .[src] The only realistic alternatives are a test-and-branch to see whether a and b are equal, in which case the correct return value is 14, but this adds significant overhead if the pointers are not equal, and optimizations enabled by function inlining.[src] Now if a call to slow is made with the same address for a and b , there is a data dependency between the memory stores and the memory load(s) in the final statement of slow .[src] Some CPU designs (like general purpose processors for desktop or notebook computers) dedicate a significant amount of die space to complex store-to-load forwarding, which, under suitable circumstances such as native alignment of the operands, can avert having to wait for the cache roundtrip.[src] Other CPUs (e.g.[src] for embedded devices or video game consoles) may use a less elaborate or even minimalistic approach, and rely on the software developer to avoid frequent load-hit-stores in performance-critical code, or remove them during performance optimization.[src] In the minimalistic approach, a store-to-load dependency forces a flush of the store buffers and stalling the pipeline.[src] This ensures that the computation has the correct result, at a high performance cost.[src] ==References==[src]

22 sentences · 22 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Load-Hit-Store." encyclopegia.org, 2023, https://encyclopegia.org/wiki/load-hit-store. Accessed 05 December 2026.

Chicago

"Load-Hit-Store." encyclopegia.org. Accessed December 5, 2026. https://encyclopegia.org/wiki/load-hit-store.

APA

encyclopegia.org. (2023). Load-Hit-Store. Retrieved December 5, 2026, from https://encyclopegia.org/wiki/load-hit-store

Accessed December 5, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1171508156 · 0.5 · snapshot enwiki-001171508156

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.