<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/111920>111920</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Bolt: BAT is forward-incompatible between bolt-18 and bolt-19
</td>
</tr>
<tr>
<th>Labels</th>
<td>
BOLT
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
itrofimow
</td>
</tr>
</table>
<pre>
What I did:
1. Built the binary `baseline_emit_relocs` with `-Wl,--emit-relocs`
2. Gathered the profile: `perf record -e cycles:u -j any,u -o perfdata/baseline_emit_relocs.perf.data -p $(pidof baseline_emit_relocs) sleep 20`
3. Converted the profile into yaml-format with **bolt-19** (to which perf2bolt resolves): `perf2bolt baseline_emit_relocs --perfdata=perfdata/baseline_emit_relocs.perf.data --profile-format=yaml -w profiles/baseline_emit_relocs.bolt.yaml -o /dev/null`
4. Bolt-ed the original binary with **bolt-18**: `llvm-bolt-18 baseline_emit_relocs -o bolted_bat --data=profiles/baseline_emit_relocs.bolt.yaml --reorder-blocks=ext-tsp --reorder-functions=cdsort --split-functions --split-all-cold --split-eh --dyno-stats --update-debug-sections --infer-stale-profile --enable-bat`
5. Gathered the profiled from bolt-ed binary: `perf record -e cycles:u -j any,u -o perfdata/bolted_bat.perf.data -p $(pidof bolted_bat) sleep 20`
6. Tried to convert the profile into yaml-format with **bolt-19** (to which perf2bolt resolves): `perf2bolt bolted_bat --perfdata=perfdata/bolted_bat.perf.data --profile-format=yaml -w profiles/bolted_bat.bolt.yaml -o /dev/null`
which resulted in error `BOLT-ERROR: failed to parse BOLT address translation table.`
----
So I need
* yaml-format when converting the profile for `--infer-stale-profile` to work when bolting the binary later
* `--enable-bat` when bolting the binary for profile collection to work on bolt-ed binary
* **bolt-19** for converting profiles of bolt-ed binaries into yaml-format (bolt-18 fails with `BOLT-ERROR: unable to save profile in YAML format for input file processed by BOLT. Please remove -w option and use branch profile.`)
to enable continuous-bolting in production, but forward-incompatibility of BAT gets in the way.
----
1. Is BAT intended to be compatible between bolt versions?
2. If not, are there any ways to convert `perf.data` of bolt-ed binary into `.yaml` profile _somehow_ (maybe with additional hops through fdata?) with **bolt-18**?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VkFv4zYT_TX0ZUBBohzHPujgJJ8_BNhiizTAoqeAEkcWdylSICm7_vfFSLLiZJ1FigK9JLCHnHkz772hZQh6bxELdnPHbh4Wso-N84WO3tW6dcdF6dSp-NbICI-gtGL5lqUPLN1mCdz12kSIDUKprfQnYKu0lAGNtviCrY4vHo2rAlulcNSxoTj_Zpi455zCfA6PKUUC_5exQY9qyNoRBoMs39LNDn0NHivnFXCE6lQZDCzf9sC_g7QnJu574A7onJJRMrG7BiaheEIHgHfAxJKJdaeVq-EqdLGBYBA7EOmMM0_g3tkD-vgWKGgbHZxka3jtfCvj1LXYMrEtnYk824wfgIl1dHBsdNUMgAWFwWNw5oBU9aLpMXYNHXA-d5s__IPG-YR4wsnyB0IN_HhuJXyUhLAk42EHTOwUHpjY2d6YeTzLBO6o2Wk4zuu9ttKcRfLTTNbjh6ljYw4tnwIfNO2A4qheShmB83P7n0fOPTqv0PPSuOpHYPkD_hV5DN1FqO5tFbWzFK1UcJ5Khc7o-Bqav5HG8MoZNX-BDQE7WcdDlJEO9p2SEbnCst_zgHMCbWv0dMrgmRXgHK0sDfJSxnmsN9fdoaD2rh0mQhMfh_wvLDNP9hdGmc9ctccqgWevCaWDavTJf-eSS2F84I2rHX7OEa9XP-GD8e-I3mPo6S5oC-i98wT77uuXZ_6_p6evT9RHLQc2o4NO-oBAUZBKeQwBopc2GEmigUjSSN6V4Zzzy89_OHgEi6hg-lZs3868QXtmR9v9G4LqEd5VbdIuJ06c_zHmoEGcE0wONzKify07pHoj6A9vUuUzisoZM9pkLujse52_FrkiH8p20eKZSJgkPKfRGH4WJRPr8xYiZsL8gr1lrR_6IoRBHi41Dn9uf_sCUzJCom3XRxiinXc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