Skip to content

[LLVM][Docs] Add language reference for llvm.readsteadycounter #132040

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
Mar 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14562,6 +14562,33 @@ is lowered to a constant 0.
Note that runtime support may be conditional on the privilege-level code is
running at and the host platform.

'``llvm.readsteadycounter``' Intrinsic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Syntax:
"""""""

::

declare i64 @llvm.readsteadycounter()

Overview:
"""""""""

The '``llvm.readsteadycounter``' intrinsic provides access to the fixed
frequency clock on targets that support it. Unlike '``llvm.readcyclecounter``',
this clock is expected to tick at a constant rate, making it suitable for
measuring elapsed time. The actual frequency of the clock is implementation
defined.

Semantics:
""""""""""

When directly supported, reading the steady counter should not modify any
memory. Implementations are allowed to either return an application
specific value or a system wide value. On backends without support, this
is lowered to a constant 0.

'``llvm.clear_cache``' Intrinsic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
Loading