[all-commits] [llvm/llvm-project] c9d90f: [Exegesis][AArch64] Use more generic cycles counte...

Roman Belenov via All-commits all-commits at lists.llvm.org
Sun Mar 30 17:00:15 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c9d90f15af0c5ed6ad5c5cd3aa988139a2cc34e4
      https://github.com/llvm/llvm-project/commit/c9d90f15af0c5ed6ad5c5cd3aa988139a2cc34e4
  Author: Roman Belenov <103195329+r-belenov at users.noreply.github.com>
  Date:   2025-03-30 (Sun, 30 Mar 2025)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64PfmCounters.td
    M llvm/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp

  Log Message:
  -----------
  [Exegesis][AArch64] Use more generic cycles counter (#133376)

CPU_CYCLES counter does not work on some Aarch64 CPUs; CYCLES is more
generic and is equivalent to CPU_CYCLES in case the latter is supported.

Longer story - CPU_CYCLES work only on CPU models explicitly recognized
by libpfm4 ( via pfm_arm_detect_*() functions in
https://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree/lib/pfmlib_arm_armv8.c
) and its name is consistent with ARM documentation. However, the
counter is architectural and is supported on all ARMv8 CPUs; libpfm4
recognizes generic PMU on unknown ARMv8 CPUs, but does not provide
CPU_CYCLES event. Instead, CYCLES is provided (an alias to
PERF_COUNT_HW_CPU_CYCLES). Physically, it is the same event with code
0x11. On supported architectures CYCLES also work, so the change should
not introduce regression.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list