From 118a76754a0601c7bff80fa1ab74285f4f544a7b Mon Sep 17 00:00:00 2001 From: Jason Andrews Date: Tue, 18 Mar 2025 18:30:32 +0000 Subject: [PATCH] Minor edits to function multiversioning Learning Path --- .../function-multiversioning/changes-from-past-releases.md | 4 +++- .../function-multiversioning/implementation-details.md | 2 +- .../cross-platform/function-multiversioning/semantics.md | 2 +- .../cross-platform/function-multiversioning/streaming-mode.md | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/content/learning-paths/cross-platform/function-multiversioning/changes-from-past-releases.md b/content/learning-paths/cross-platform/function-multiversioning/changes-from-past-releases.md index 64757a4e7e..aa948f2aae 100644 --- a/content/learning-paths/cross-platform/function-multiversioning/changes-from-past-releases.md +++ b/content/learning-paths/cross-platform/function-multiversioning/changes-from-past-releases.md @@ -15,7 +15,9 @@ layout: learningpathall #### Semantic changes between LLVM 19 and LLVM 20 -With LLVM 19 at least one more version other than the default is needed to trigger function multiversioning. With LLVM 20 a header file declaration: +With LLVM 19 at least one more version other than the default is needed to trigger function multiversioning. + +With LLVM 20 a header file declaration: ```c __attribute__((target_version("default"))) void f(void); diff --git a/content/learning-paths/cross-platform/function-multiversioning/implementation-details.md b/content/learning-paths/cross-platform/function-multiversioning/implementation-details.md index 1ca25e8e82..6b8a87ccc3 100644 --- a/content/learning-paths/cross-platform/function-multiversioning/implementation-details.md +++ b/content/learning-paths/cross-platform/function-multiversioning/implementation-details.md @@ -101,6 +101,6 @@ When compiling `file2.c` a resolver is emitted for `func1` due to the presence o Normally the called symbol is resolved at runtime (dynamically), however it may be possible to determine which function version to call at compile time (statically). -This may be possible when the caller function is compiled with a sufficiently high set of architecture features (explicitly by using the `target` attribute as an optimization hint, or the multiversioning attributes `target_version`/`target_clones`, and implicitly via command line options). See [the example](/learning-paths/cross-platform/function-multiversioning/changes-from-past-releases). +This may be possible when the caller function is compiled with a sufficiently high set of architecture features (explicitly by using the `target` attribute as an optimization hint, or the multiversioning attributes `target_version`/`target_clones`, and implicitly via command line options). Refer the the example in the next section for details. The compiler optimizes calls to versioned functions which can be statically resolved into direct calls. As a result the versioned function may be inlined into the call site. diff --git a/content/learning-paths/cross-platform/function-multiversioning/semantics.md b/content/learning-paths/cross-platform/function-multiversioning/semantics.md index 56534b57ea..0d758518bc 100644 --- a/content/learning-paths/cross-platform/function-multiversioning/semantics.md +++ b/content/learning-paths/cross-platform/function-multiversioning/semantics.md @@ -1,5 +1,5 @@ --- -title: About Function Multiversioning +title: About function multiversioning weight: 2 ### FIXED, DO NOT MODIFY diff --git a/content/learning-paths/cross-platform/function-multiversioning/streaming-mode.md b/content/learning-paths/cross-platform/function-multiversioning/streaming-mode.md index be36a0040b..1750c2b62b 100644 --- a/content/learning-paths/cross-platform/function-multiversioning/streaming-mode.md +++ b/content/learning-paths/cross-platform/function-multiversioning/streaming-mode.md @@ -6,7 +6,7 @@ weight: 6 layout: learningpathall --- -Function Multi Versioning is compatible with Arm streaming mode as long as the same calling convention is used across all function versions. +Function multiversioning is compatible with Arm streaming mode as long as the same calling convention is used across all function versions. Use a text editor to create a file named `streaming.c` with the code below: