[llvm] [BOLT][AArch64] Introduce SPE mode in BasicAggregation (PR #120741)

Paschalis Mpeis via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 06:56:12 PST 2025


paschalis-mpeis wrote:

> With SPE, if we're able to distinguish taken branches from not taken, I think we can similarly make that part of profile data so won't need `infer-fall-through`. If we can't distinguish them, but can filter by taken branches only, then we'd need to use `infer-fall-throughs` to assign fallthrough counts after taken branch counters are attached to a CFG.

Currently, there is no such information but we could expose it with more follow-up patches on perf/linux. Please note that if we filter-out any non-taken branches at this point (ie `perf script`), then we'll exclude information we cannot later infer.

Given the SPE limitations I've explained in my previous comment, will this taken/not-taken additional information (or the infer flag) help propagating additional CFG hotness data?
Let's assume we captured the below entries:
- `Branch1` (taken) -> `Block1`
- `Branch2` (fallthrough) -> `Block2`

Regardless of whether the source branch was FT or Taken, we still don't know what will happen in `Block1` and `Block2` in terms of branching. I think BOLT will not be able to propagate information past these blocks, unless those are part of some extended basic block (EBB). In that case, it depends on how BOLT deals with EBBs and whether it lacks any support for them in BasicAggregation (thus giving an advantage to the LBR-format)?


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


More information about the llvm-commits mailing list