[Lldb-commits] [clang] [lldb] [llvm] [BOLT] Drop blocks without profile in BAT YAML (PR #107970)

2024-09-11 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed 
https://github.com/llvm/llvm-project/pull/107970
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [BOLT] Drop blocks without profile in BAT YAML (PR #107970)

2024-09-11 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited 
https://github.com/llvm/llvm-project/pull/107970
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [BOLT] Drop blocks without profile in BAT YAML (PR #107970)

2024-09-11 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited 
https://github.com/llvm/llvm-project/pull/107970
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [BOLT] Add profile-use-pseudo-probes option (PR #100299)

2024-07-24 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed 
https://github.com/llvm/llvm-project/pull/100299
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [BOLT] Add profile-use-pseudo-probes option (PR #100299)

2024-07-24 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited 
https://github.com/llvm/llvm-project/pull/100299
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [BOLT] Support more than two jump table parents (PR #99988)

2024-07-24 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/99988
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [BOLT] Support more than two jump table parents (PR #99988)

2024-07-24 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/99988
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [BOLT][NFC] Track fragment relationships using EquivalenceClasses (PR #99979)

2024-07-24 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/99979
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [BOLT][NFC] Track fragment relationships using EquivalenceClasses (PR #99979)

2024-07-24 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/99979
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libcxx] [lldb] [llvm] [mlir] [BOLT][BAT] Add entries for deleted basic blocks (PR #91906)

2024-05-24 Thread Amir Ayupov via lldb-commits

aaupov wrote:

The entries for deleted basic blocks won't participate in 
`BAT::getFallthroughsInTrace` because trace boundary is looked up by output 
offsets: 
https://github.com/llvm/llvm-project/blob/098c6dfa8157681699a71fce9e3d94515e66311f/bolt/lib/Profile/BoltAddressTranslation.cpp#L529-L540

But deleted blocks will be used in `writeBATYAML` where we lookup containing 
blocks by input offsets: 
https://github.com/llvm/llvm-project/blob/098c6dfa8157681699a71fce9e3d94515e66311f/bolt/lib/Profile/DataAggregator.cpp#L2358-L2367

https://github.com/llvm/llvm-project/pull/91906
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libcxx] [lldb] [llvm] [mlir] [BOLT][BAT] Add entries for deleted basic blocks (PR #91906)

2024-05-23 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/91906
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libcxx] [lldb] [llvm] [mlir] [BOLT][BAT] Add entries for deleted basic blocks (PR #91906)

2024-05-23 Thread Amir Ayupov via lldb-commits

aaupov wrote:

> Could you elaborate a bit better on why do we need a deleted block to be 
> present in the table? My memory fails me, aren't we using the translation 
> table just to map samples collected on the bolted binary? Where do the 
> deleted blocks become a problem?
> 
> Other than the motivation, the implementation itself looks good to me.

We need deleted blocks to correctly map optimized tail calls to containing 
basic blocks. Because we expand tail calls during CFG construction, and attach 
the profile to that CFG, we need those intermediate blocks to be present in the 
profile. bb

-with-two-tail-calls offers a good example:
after building CFG (details omitted):
```
.LBB00 (1 instructions, align : 1)
:   je  .Ltmp0 # Offset: 0

.LFT0 (2 instructions, align : 1)
0002:   ja  .Ltmp1 # Offset: 2
0004:   jmp .Ltmp2 # Offset: 4

.Ltmp0 (1 instructions, align : 1)
0006:   retq # Offset: 6

.Ltmp1 (1 instructions, align : 1)
0007:   jmp e # TAILCALL  # Offset: 7

.Ltmp2 (2 instructions, align : 1)
000c:   nop # Offset: 12 # Size: 1 # NOP: 1
000d:   jmp f # TAILCALL  # Offset: 13
```

after SCTC, we normally write out BAT from that state:
```
.LBB00 (1 instructions, align : 1)
:   je  .Ltmp0 # Offset: 0

.LFT0 (2 instructions, align : 1)
0002:   ja  e # TAILCALL  # Offset: 7 # CTCTakenCount: 4
0004:   jmp f # TAILCALL  # Offset: 13

.Ltmp0 (1 instructions, align : 1)
0009:   retq # Offset: 6
```

So in order to map this branch
```
0004:   jmp f # TAILCALL  # Offset: 13
```

to its block Ltmp2 we need to preserve the block entry in BAT, although it's 
removed from CFG.

https://github.com/llvm/llvm-project/pull/91906
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [flang] [libcxx] [libcxxabi] [lld] [lldb] [llvm] [mlir] [BOLT] Ignore special symbols as function aliases in updateELFSymbolTable (PR #92713)

2024-05-20 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/92713
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [flang] [libcxx] [libcxxabi] [lld] [lldb] [llvm] [mlir] [BOLT] Ignore special symbols as function aliases in updateELFSymbolTable (PR #92713)

2024-05-20 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/92713
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [libcxx] [lldb] [llvm] [mlir] [BOLT][BAT] Add entries for deleted basic blocks (PR #91906)

2024-05-16 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/91906
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [BOLT][NFC] Rename DataAggregator::BranchInfo to TakenBranchInfo (PR #92017)

2024-05-16 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/92017
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [BOLT][NFC] Rename DataAggregator::BranchInfo to TakenBranchInfo (PR #92017)

2024-05-16 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/92017
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [BOLT] Set entry counts in BAT YAML profile (PR #91775)

2024-05-10 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/91775
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [BOLT] Set entry counts in BAT YAML profile (PR #91775)

2024-05-10 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/91775
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [BOLT] Use disambiguated local names in BAT YAML (PR #91773)

2024-05-10 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/91773
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [BOLT] Use disambiguated local names in BAT YAML (PR #91773)

2024-05-10 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/91773
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Support custom LLVM formatting for variables (PR #81196)

2024-04-30 Thread Amir Ayupov via lldb-commits

aaupov wrote:

This diff broke buildbot: 
https://lab.llvm.org/buildbot/#/builders/68/builds/73367

https://github.com/llvm/llvm-project/pull/81196
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [llvm] [clang-tools-extra] [clang] [lldb] [flang] [openmp] [libc] [mlir] [BOLT] Deduplicate equal offsets in BAT (PR #76905)

2024-01-25 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/76905
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [llvm] [clang-tools-extra] [clang] [lldb] [flang] [openmp] [libc] [mlir] [BOLT] Deduplicate equal offsets in BAT (PR #76905)

2024-01-25 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/76905
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [clang] [llvm] [BOLT] Fix unconditional output of boltedcollection in merge-fdata (PR #78653)

2024-01-18 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/78653
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [clang] [llvm] [BOLT] Fix unconditional output of boltedcollection in merge-fdata (PR #78653)

2024-01-18 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/78653
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang-tools-extra] [flang] [clang] [libcxx] [mlir] [llvm] [openmp] [libc] [lldb] [BOLT] Use continuous output addresses in delta encoding in BAT (PR #76904)

2024-01-18 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/76904
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang-tools-extra] [flang] [clang] [libcxx] [mlir] [llvm] [openmp] [libc] [lldb] [BOLT] Use continuous output addresses in delta encoding in BAT (PR #76904)

2024-01-18 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov updated 
https://github.com/llvm/llvm-project/pull/76904

>From 2027bc7dc00395884c3bd4da21bbb79d079293fc Mon Sep 17 00:00:00 2001
From: Amir Ayupov 
Date: Wed, 3 Jan 2024 21:25:27 -0800
Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?=
 =?UTF-8?q?anges=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4

[skip ci]
---
 bolt/docs/BAT.md  |  91 
 .../bolt/Profile/BoltAddressTranslation.h |  14 +-
 bolt/lib/Profile/BoltAddressTranslation.cpp   | 138 ++
 bolt/lib/Rewrite/RewriteInstance.cpp  |   1 +
 bolt/test/X86/bolt-address-translation.test   |   2 +-
 5 files changed, 180 insertions(+), 66 deletions(-)
 create mode 100644 bolt/docs/BAT.md

diff --git a/bolt/docs/BAT.md b/bolt/docs/BAT.md
new file mode 100644
index 00..5a257a46955607
--- /dev/null
+++ b/bolt/docs/BAT.md
@@ -0,0 +1,91 @@
+# BOLT Address Translation (BAT)
+# Purpose
+A regular profile collection for BOLT involves collecting samples from
+unoptimized binary. BOLT Address Translation allows collecting profile
+from BOLT-optimized binary and using it for optimizing the input (pre-BOLT)
+binary.
+
+# Overview
+BOLT Address Translation is an extra section (`.note.bolt_bat`) inserted by 
BOLT
+into the output binary containing translation tables and split functions 
linkage
+information. This information enables mapping the profile back from optimized
+binary onto the original binary.
+
+# Usage
+`--enable-bat` flag controls the generation of BAT section. Sampled profile 
+needs to be passed along with the optimized binary containing BAT section to
+`perf2bolt` which reads BAT section and produces fdata profile for the original
+binary. Note that YAML profile generation is not supported since BAT doesn't
+contain the metadata for input functions.
+
+# Internals
+## Section contents
+The section is organized as follows:
+- Hot functions table
+  - Address translation tables
+- Cold functions table
+
+## Construction and parsing
+BAT section is created from `BoltAddressTranslation` class which captures
+address translation information provided by BOLT linker. It is then encoded as 
a
+note section in the output binary.
+
+During profile conversion when BAT-enabled binary is passed to perf2bolt, 
+`BoltAddressTranslation` class is populated from BAT section. The class is then
+queried by `DataAggregator` during sample processing to reconstruct addresses/
+offsets in the input binary.
+
+## Encoding format
+The encoding is specified in bolt/include/bolt/Profile/BoltAddressTranslation.h
+and bolt/lib/Profile/BoltAddressTranslation.cpp.
+
+### Layout
+The general layout is as follows:
+```
+Hot functions table header
+|--|
+|  Function entry  |
+| |--| |
+| | OutOff InOff | |
+| |--| |
+
+
+Cold functions table header
+|--|
+|  Function entry  |
+| |--| |
+| | OutOff InOff | |
+| |--| |
+
+```
+
+### Functions table
+Hot and cold functions tables share the encoding except difference marked 
below.
+Header:
+| Entry  | Encoding | Description |
+| -- | - | --- |
+| `NumFuncs` | ULEB128 | Number of functions in the functions table |
+
+The header is followed by Functions table with `NumFuncs` entries.
+Output binary addresses are delta encoded, meaning that only the difference 
with
+the previous output address is stored. Addresses implicitly start at zero.
+Hot indices are delta encoded, implicitly starting at zero.
+| Entry  | Encoding | Description |
+| -- | --| --- |
+| `Address` | Delta, ULEB128 | Function address in the output binary |
+| `HotIndex` | Delta, ULEB128 | Cold functions only: index of corresponding 
hot function in hot functions table |
+| `NumEntries` | ULEB128 | Number of address translation entries for a 
function |
+Function header is followed by `NumEntries` pairs of offsets for current
+function.
+
+### Address translation table
+Delta encoding means that only the difference with the previous corresponding
+entry is encoded. Offsets implicitly start at zero.
+| Entry  | Encoding | Description |
+| -- | --| --- |
+| `OutputAddr` | Delta, ULEB128 | Function offset in output binary |
+| `InputAddr` | Delta, SLEB128 | Function offset in input binary with 
`BRANCHENTRY` LSB bit |
+
+`BRANCHENTRY` bit denotes whether a given offset pair is a control flow source
+(branch or call instruction). If not set, it signifies a control flow target
+(basic block offset).
diff --git a/bolt/include/bolt/Profile/BoltAddressTranslation.h 
b/bolt/include/bolt/Profile/BoltAddressTranslation.h
index 07e4b283211c69..feeda2ca1871be 100644
--- a/bolt/include/bolt/Profile/BoltAddressTranslation.h
+++ b/bolt/include/bolt/Profile/BoltAddressTranslation.h
@@

[Lldb-commits] [clang] [lldb] [libcxx] [mlir] [openmp] [clang-tools-extra] [flang] [libc] [llvm] [BOLT] Use continuous output addresses in delta encoding in BAT (PR #76904)

2024-01-18 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/76904
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [openmp] [clang-tools-extra] [libc] [flang] [llvm] [libcxx] [clang] [mlir] [lldb] [BOLT] Use continuous output addresses in delta encoding in BAT (PR #76904)

2024-01-18 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/76904
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [clang-tools-extra] [flang] [openmp] [libcxx] [clang] [libc] [llvm] [mlir] [BOLT] Embed cold mapping info into function entry in BAT (PR #76903)

2024-01-12 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/76903
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [clang-tools-extra] [flang] [openmp] [libcxx] [clang] [libc] [llvm] [mlir] [BOLT] Embed cold mapping info into function entry in BAT (PR #76903)

2024-01-12 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/76903
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [llvm] [clang-tools-extra] [lldb] [clang] [libc] [libcxx] [mlir] [openmp] [flang] [BOLT] Delta-encode function start addresses in BAT (PR #76902)

2024-01-11 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/76902
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [llvm] [clang-tools-extra] [lldb] [clang] [libc] [libcxx] [mlir] [openmp] [flang] [BOLT] Delta-encode function start addresses in BAT (PR #76902)

2024-01-11 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/76902
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [libc] [flang] [llvm] [libcxx] [mlir] [clang] [clang-tools-extra] [BOLT] Delta-encode function start addresses in BAT (PR #76902)

2024-01-11 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/76902
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [mlir] [lldb] [clang] [flang] [libc] [llvm] [clang-tools-extra] [libcxx] [BOLT] Delta-encode offsets in BAT (PR #76900)

2024-01-11 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/76900
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [mlir] [lldb] [clang] [flang] [libc] [llvm] [clang-tools-extra] [libcxx] [BOLT] Delta-encode offsets in BAT (PR #76900)

2024-01-11 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/76900
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [libcxx] [libc] [clang-tools-extra] [llvm] [lldb] [clang] [mlir] [BOLT][NFC] Print BAT section size (PR #76897)

2024-01-11 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov closed https://github.com/llvm/llvm-project/pull/76897
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [llvm] [clang] [libcxx] [clang-tools-extra] [mlir] [lldb] [libc] [BOLT][NFC] Print BAT section size (PR #76897)

2024-01-04 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov updated 
https://github.com/llvm/llvm-project/pull/76897

>From 5106f9e921aa426cf3272277c4aee4bdf76215e8 Mon Sep 17 00:00:00 2001
From: Amir Ayupov 
Date: Wed, 3 Jan 2024 21:25:02 -0800
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4
---
 bolt/lib/Rewrite/RewriteInstance.cpp| 1 +
 bolt/test/X86/bolt-address-translation.test | 1 +
 2 files changed, 2 insertions(+)

diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp 
b/bolt/lib/Rewrite/RewriteInstance.cpp
index a95b1650753cfd..f5a8a5b7168745 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -4112,6 +4112,7 @@ void RewriteInstance::encodeBATSection() {
   copyByteArray(BoltInfo), BoltInfo.size(),
   /*Alignment=*/1,
   /*IsReadOnly=*/true, ELF::SHT_NOTE);
+  outs() << "BOLT-INFO: BAT section size (bytes): " << BoltInfo.size() << '\n';
 }
 
 template 
diff --git a/bolt/test/X86/bolt-address-translation.test 
b/bolt/test/X86/bolt-address-translation.test
index f68a8f7e9bcb7f..c5813b411d87ba 100644
--- a/bolt/test/X86/bolt-address-translation.test
+++ b/bolt/test/X86/bolt-address-translation.test
@@ -37,6 +37,7 @@
 # CHECK:  BOLT: 3 out of 7 functions were overwritten.
 # CHECK:  BOLT-INFO: Wrote 6 BAT maps
 # CHECK:  BOLT-INFO: Wrote 3 BAT cold-to-hot entries
+# CHECK:  BOLT-INFO: BAT section size (bytes): 1436
 #
 # usqrt mappings (hot part). We match against any key (left side containing
 # the bolted binary offsets) because BOLT may change where it puts instructions

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [llvm] [clang] [libcxx] [clang-tools-extra] [mlir] [lldb] [libc] [BOLT][NFC] Print BAT section size (PR #76897)

2024-01-04 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov updated 
https://github.com/llvm/llvm-project/pull/76897

>From 5106f9e921aa426cf3272277c4aee4bdf76215e8 Mon Sep 17 00:00:00 2001
From: Amir Ayupov 
Date: Wed, 3 Jan 2024 21:25:02 -0800
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4
---
 bolt/lib/Rewrite/RewriteInstance.cpp| 1 +
 bolt/test/X86/bolt-address-translation.test | 1 +
 2 files changed, 2 insertions(+)

diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp 
b/bolt/lib/Rewrite/RewriteInstance.cpp
index a95b1650753cfd..f5a8a5b7168745 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -4112,6 +4112,7 @@ void RewriteInstance::encodeBATSection() {
   copyByteArray(BoltInfo), BoltInfo.size(),
   /*Alignment=*/1,
   /*IsReadOnly=*/true, ELF::SHT_NOTE);
+  outs() << "BOLT-INFO: BAT section size (bytes): " << BoltInfo.size() << '\n';
 }
 
 template 
diff --git a/bolt/test/X86/bolt-address-translation.test 
b/bolt/test/X86/bolt-address-translation.test
index f68a8f7e9bcb7f..c5813b411d87ba 100644
--- a/bolt/test/X86/bolt-address-translation.test
+++ b/bolt/test/X86/bolt-address-translation.test
@@ -37,6 +37,7 @@
 # CHECK:  BOLT: 3 out of 7 functions were overwritten.
 # CHECK:  BOLT-INFO: Wrote 6 BAT maps
 # CHECK:  BOLT-INFO: Wrote 3 BAT cold-to-hot entries
+# CHECK:  BOLT-INFO: BAT section size (bytes): 1436
 #
 # usqrt mappings (hot part). We match against any key (left side containing
 # the bolted binary offsets) because BOLT may change where it puts instructions

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits