Skip to content

Conversation

@sjoerdmeijer
Copy link
Collaborator

Claiming AArch64 support for llvm-exegesis is a bit of a stretch in my opinion as only a couple of opcodes with GPR64 operands will work, so I propose to clarify that AArch64 support is very experimental. Also added some clarifications about its libpfm4 dependency.

@llvmbot
Copy link
Member

llvmbot commented Nov 5, 2024

@llvm/pr-subscribers-llvm-binary-utilities

@llvm/pr-subscribers-tools-llvm-exegesis

Author: Sjoerd Meijer (sjoerdmeijer)

Changes

Claiming AArch64 support for llvm-exegesis is a bit of a stretch in my opinion as only a couple of opcodes with GPR64 operands will work, so I propose to clarify that AArch64 support is very experimental. Also added some clarifications about its libpfm4 dependency.


Full diff: https://github.com/llvm/llvm-project/pull/114989.diff

2 Files Affected:

  • (modified) llvm/docs/CommandGuide/llvm-exegesis.rst (+7-5)
  • (modified) llvm/tools/llvm-exegesis/README.md (+11-3)
diff --git a/llvm/docs/CommandGuide/llvm-exegesis.rst b/llvm/docs/CommandGuide/llvm-exegesis.rst
index fdf17c7fe41285..102c4eb47e9d60 100644
--- a/llvm/docs/CommandGuide/llvm-exegesis.rst
+++ b/llvm/docs/CommandGuide/llvm-exegesis.rst
@@ -33,11 +33,13 @@ snippets.
 SUPPORTED PLATFORMS
 -------------------
 
-:program:`llvm-exegesis` currently only supports X86 (64-bit only), ARM (AArch64
-only), MIPS, and PowerPC (PowerPC64LE only) on Linux for benchmarking. Not all
-benchmarking functionality is guaranteed to work on every platform.
-:program:`llvm-exegesis` also has a separate analysis mode that is supported
-on every platform that LLVM is.
+:program:`llvm-exegesis` currently only supports X86 (64-bit only), ARM
+(AArch64 only and very experimental), MIPS, and PowerPC (PowerPC64LE only) on
+Linux for benchmarking. Not all benchmarking functionality is guaranteed to
+work on every platform. :program:`llvm-exegesis` also has a separate analysis
+mode that is supported on every platform that LLVM is. See README.md for
+more information on the libpfm4 dependency and how to configure and build
+:program:`llvm-exegesis` from source.
 
 SNIPPET ANNOTATIONS
 -------------------
diff --git a/llvm/tools/llvm-exegesis/README.md b/llvm/tools/llvm-exegesis/README.md
index f606fbf8e0eb64..f68a42b05064b4 100644
--- a/llvm/tools/llvm-exegesis/README.md
+++ b/llvm/tools/llvm-exegesis/README.md
@@ -13,8 +13,16 @@ Analysis mode in `llvm-exegesis` is supported on all platforms on which LLVM is.
 #### Currently Supported Operating Systems for Benchmarking
 
 Currently, `llvm-exegesis`  only supports benchmarking on Linux. This is mainly
-due to a dependency on the Linux perf subsystem for reading performance
-counters.
+due to a dependency on the Linux perf subsystem and libpfm4 for reading
+performance counters. For benchmarking, LLVM needs to be configured and build
+with `LLVM_ENABLE_LIBPFM` enabled. Benchmarking might fail if the target cpu is
+not supported by libpfm. This can be checked by putting libpfm in verbose/debug
+mode with environment variables `LIBPFM_VERBOSE` and `LIBFM_DEBUG`. If libpfm
+is installed in a non-standard location, LLVM can be configured to look for the
+libpfm library and header file locations by setting environment variables
+`LIBRARY_PATH`, `C_INCLUDE_PATH`, and `CPLUS_INCLUDE_PATH`. In that case variable
+`LD_LIBRARY_PATH` needs to be set too so that `llvm-exegesis` can find the
+library at execution time.
 
 The subprocess execution mode and memory annotations currently only supports
 Linux due to a heavy reliance on many Linux specific syscalls/syscall
@@ -28,7 +36,7 @@ architectures:
   * 64-bit only due to this being the only implemented calling convention
     in `llvm-exegesis` currently.
 * ARM
-  * AArch64 only
+  * Very experimental AArch64 support only, most opcodes probably won't work.
 * MIPS
 * PowerPC (PowerPC64LE only)
 

:program:`llvm-exegesis` also has a separate analysis mode that is supported
on every platform that LLVM is.
:program:`llvm-exegesis` currently only supports X86 (64-bit only), ARM
(AArch64 only and very experimental), MIPS, and PowerPC (PowerPC64LE only) on
Copy link
Contributor

Choose a reason for hiding this comment

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

I would explicitly state here that snippet generation is experimental. In process snippet execution should "just work".

Maybe something like "AArch64 only, snippet generation support is sparse".

in `llvm-exegesis` currently.
* ARM
* AArch64 only
* Very experimental AArch64 support only, most opcodes probably won't work.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same clarification here.

Currently, `llvm-exegesis` only supports benchmarking on Linux. This is mainly
due to a dependency on the Linux perf subsystem for reading performance
counters.
due to a dependency on the Linux perf subsystem and libpfm4 for reading
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably go in the LLVM CMake documentation. This page isn't intended to provide detailed build directions, and people are more likely to look there.

(AArch64 only and very experimental), MIPS, and PowerPC (PowerPC64LE only) on
Linux for benchmarking. Not all benchmarking functionality is guaranteed to
work on every platform. :program:`llvm-exegesis` also has a separate analysis
mode that is supported on every platform that LLVM is. See README.md for
Copy link
Contributor

Choose a reason for hiding this comment

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

Reference the CMake documentation here. It's a bit odd to reference a README from proper documentation.

Claiming AArch64 support for llvm-exegesis is a bit of a stretch, so
clarify that that its support is very experimental. Also added some
clarifications about its libpfm4 dependency.
@sjoerdmeijer
Copy link
Collaborator Author

Thanks for the review! I have addressed all comments, I think.

Copy link
Contributor

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

Copy link
Collaborator

@davemgreen davemgreen left a comment

Choose a reason for hiding this comment

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

This matches my understanding of the support level in AArch64 at the moment. Thanks

@sjoerdmeijer sjoerdmeijer merged commit 6720ce7 into llvm:main Nov 7, 2024
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants