From f11b307dcf8afc6873869e9c5600e1c65cf6b9dc Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 19 Mar 2025 09:41:12 -0500 Subject: [PATCH] [LLVM][Docs] Add language reference for `llvm.readsteadycounter` Summary: This was not added in the original patch, add LLVM documentation. --- llvm/docs/LangRef.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index bda80d76dfaa5..abbbb44c08479 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^