Nikita Popov 979c275097
[IR] Store Triple in Module (NFC) (#129868)
The module currently stores the target triple as a string. This means
that any code that wants to actually use the triple first has to
instantiate a Triple, which is somewhat expensive. The change in #121652
caused a moderate compile-time regression due to this. While it would be
easy enough to work around, I think that architecturally, it makes more
sense to store the parsed Triple in the module, so that it can always be
directly queried.

For this change, I've opted not to add any magic conversions between
std::string and Triple for backwards-compatibilty purses, and instead
write out needed Triple()s or str()s explicitly. This is because I think
a decent number of them should be changed to work on Triple as well, to
avoid unnecessary conversions back and forth.

The only interesting part in this patch is that the default triple is
Triple("") instead of Triple() to preserve existing behavior. The former
defaults to using the ELF object format instead of unknown object
format. We should fix that as well.
2025-03-06 10:27:47 +01:00
..

llvm-exegesis

llvm-exegesis is a benchmarking tool that accepts or generates snippets and can measure characteristics of those snippets by executing it while keeping track of performance counters.

Currently Supported Platforms

llvm-exegesis is quite platform-dependent and currently only supports a couple platform configurations for benchmarking. The limitations are listed below. 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.

The subprocess execution mode and memory annotations currently only supports Linux due to a heavy reliance on many Linux specific syscalls/syscall implementations.

Currently Supported Architectures for Benchmarking

Currently, using llvm-exegesis for benchmarking is supported on the following architectures:

  • x86
    • 64-bit only due to this being the only implemented calling convention in llvm-exegesis currently.
  • ARM
    • Very experimental AArch64 support only: most opcodes probably won't work as e.g. pseudo instructions and most register classes are not supported.
  • MIPS
  • PowerPC (PowerPC64LE only)

Note that not all benchmarking functionality is guaranteed to work on all platforms.

Memory annotations are currently only supported on 64-bit X86. There is no inherent limitations for porting memory annotations to other architectures, but parts of the test harness are implemented as MCJITed assembly that is generated in ./lib/X86/Target.cpp that would need to be implemented on other architectures to bring up support.