[all-commits] [llvm/llvm-project] ff020d: [BOLT] Fix heatmaps on large BOLTE'd binaries.

Paschalis Mpeis via All-commits all-commits at lists.llvm.org
Tue Jun 25 02:18:21 PDT 2024


  Branch: refs/heads/users/paschalis-mpeis/bolt-heatmap-fix
  Home:   https://github.com/llvm/llvm-project
  Commit: ff020d9ae49deae831e07922cad0f738d9ee4cef
      https://github.com/llvm/llvm-project/commit/ff020d9ae49deae831e07922cad0f738d9ee4cef
  Author: Paschalis Mpeis (aws-mem-aarch64) <paschalis.mpeis at arm.com>
  Date:   2024-06-25 (Tue, 25 Jun 2024)

  Changed paths:
    M bolt/lib/Profile/DataAggregator.cpp

  Log Message:
  -----------
  [BOLT] Fix heatmaps on large BOLTE'd binaries.

Large binaries get two text segments mapped when loaded in memory, ie:
```
2f7200000-2fabca000 r--p 00000000        bolted-binary <- 1st text segment
2fabd9000-2fe47c000 r-xp 039c9000        bolted-binary
2fe48b000-2fe61d000 r--p 0727b000        bolted-binary
2fe62c000-2fe660000 rw-p 0740c000        bolted-binary
2fe660000-2fea4c000 rw-p 00000000
2fec00000-303dad000 r-xp 07a00000        bolted-binary <- 2nd. only on bolted binary
```

BOLT processes only the first, which is not having a correct BaseAddress,
causing a wrong computation of a BinaryMMapInfo's size.

Consequently, BOLT wrongly thinks that many of the samples fall outside
the binary and ignores them. As a result, the computed heatmap is
incomplete, and the section hotness statistics are wrong.

This bug is present in both the AArch64 and x86 backends.



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