[llvm] [RISCV][llvm-exegesis] Add default Pfm cycle counter. (PR #121866)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 19:06:31 PST 2025


topperc wrote:

> LGTM for Pfm Counter changes.
> 
> Is it possible for you to use spr/graphite for stacked PRs (or even just manually stack them on Github by setting the branches appropriately on the origin repo)? For this one it doesn't matter too much, but having extra changes stacked in can be a bit confusing.
> 
> Everything being 0.5 cycles higher than expected is a bit weird. What are your benchmark settings like? It might be worth trying `repetition-mode=middle-half-duplicate|middle-half-loop` (the latter with a decent `--loop-body-size` for single instruction benchmarking to see if it's just a constant overhead (although that seems unlikely given it's 0.5 cycles for instructions with a huge range of latencies).
> 
> Not sure if the counter used by the perf subsystem for `CYCLES` is good either. I know on X86 counters can be particularly tricky. Fixing that would probably require bringing up libpfm for RISCV though which would not be a super trivial effort.

Using `repetition-mode=middle-half-duplicate|middle-half-loop` both gave a value closer to 1.0 for simple scalar, and 3.0 for mul. I was using the default before. This is my first time running llvm-exegesis.

https://github.com/llvm/llvm-project/pull/121866


More information about the llvm-commits mailing list