<div dir="ltr">I'm probably not the most relevant opinion here, so take any of this with a grain of salt: Generally I'd err towards inclusion in the llvm subproject, as you say, for easy movement of code into reusable libraries, etc - though I guess if you're a sibling like clang or lld that's still possible - sinking code down into the common llvm infrastructure as desired.<br>How much code is bolt? If it's in llvm, how much more CPU time does it add to build and test?<br><br>As for testing - is llvm-mc'd assembly sufficient for testing? That might be a tipping point in deciding whether it should live separately (so that folks can opt out of it)<br>"real-world test binaries" are probably not at thing that should be part of the usual testing, if by that you mean existing/production binaries, as opposed to small targeted binaries of only a few instructions (enough to demonstrate some specific feature of bolt). In the same way that lld's test suite doesn't have "real world" object files being linked into full production binaries, but small targeted/hand-crafted examples.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 10, 2021 at 7:29 PM Rafael Auler via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="gmail-m_-2686349641601647448WordSection1">
<p class="MsoNormal">Hi,<br>
<br>
We finished rebasing BOLT on top of the LLVM monorepo and we verified that the new BOLT is performing as expected. To make BOLT work, we have a few changes to LLVM libs, which we will submit for review (first changes are already up:
<a href="https://reviews.llvm.org/D97531" target="_blank">D97531</a>, D97830, D97899, D97898, D97891, D97830).<br>
<br>
The plan for the initial BOLT commit is to include all its parts under a single directory, either /bolt or /llvm/tools/llvm-bolt. Once complete, this approach will allow people to directly contribute to the project and start using BOLT as part of LLVM. After
this phase, we would like to start working with the community to break BOLT into separate components that will make it easier to build new tools based on the BOLT technology. As suggested by Propeller folks, we will split the disassembler component from the
rest and make it possible to perform optimizations on low-level binary IR, which will likely have a serializable form.<br>
<br>
It's still unclear, though, the proper location of BOLT in the monorepo. In our rebased branch, we are currently in a /bolt top-level folder in the monorepo, but are also considering /llvm/tools/llvm-bolt.<br>
<br>
We are trying to work out the pros and cons of living in these locations and would appreciate community input. From our understanding, living under the /bolt top-level folder would give BOLT the following advantages:<br>
<br>
- More independence to build a test infrastructure for BOLT. We could make check-bolt depend on LLD, for instance, if we need to build binaries on the fly to test BOLT features. Generating test inputs is a big problem for us, since we can't add real-world test
binaries into the LLVM repo (which are awkward to track in the repo and also use a lot of space).<br>
- We would share a similarity with other large projects such as flang and lld in location: these projects have their own top-level folder too.<br>
- It would make more sense to live in a top-level folder because we intend to support building multiple tools (llvm-bolt, llvm-boltdiff, perf2bolt, merge-fdata). Living under llvm/tools is typically reserved for simpler single-binary projects.<br>
<br>
Living in /llvm/tools/llvm-bolt, on the other hand, is perhaps more aligned with a longer-term goal of migrating BOLT to live as a lib under /llvm/lib and has the following advantages:<br>
<br>
- Piggybacking on the LLVM release process, BOLT is released along with other llvm tools<br>
- Piggybacking on buildbots being configured to build llvm tools, the project is more robust and well tested<br>
- BOLT was originally developed to live under tools, and the project was named llvm-bolt to reflect that<br>
- Being closer to LLVM will allow BOLT to migrate functionality more easily to llvm/lib
<br>
<br>
Any thoughts on this?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal" style="margin-bottom:12pt"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>> on behalf of Rafael Auler via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>
<b>Date: </b>Tuesday, January 26, 2021 at 4:54 PM<br>
<b>To: </b>Andrey Bokhanko <<a href="mailto:andreybokhanko@gmail.com" target="_blank">andreybokhanko@gmail.com</a>>, llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>, Maksim Panchenko <<a href="mailto:maks@fb.com" target="_blank">maks@fb.com</a>><br>
<b>Subject: </b>Re: [llvm-dev] [RFC] BOLT: A Framework for Binary Analysis, Transformation, and Optimization<u></u><u></u></span></p>
</div>
<p class="MsoNormal">Hi Andrey,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">We appreciate your interest and we look forward to collaborating. We are currently rebasing BOLT on top of LLVM trunk. Since it’s been a while since the last rebase, this is a bit of an involved task and we need to work through a rather
lengthy list of conflicts. After we finish this and make sure BOLT works on the new repo, we plan to publish the list of commits and the merging diff so the community can evaluate a project merge proposal that works.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Regarding the project organization, remember BOLT was created before llvm monorepo. To address this, we are currently going for a similar approach to the one used by flang, re-editing all of our history on top of a new folder structure
(root repo /bolt, similar to /flang), but trying to keep old commits mostly intact so we preserve project history -- I’m happy to change this to whatever makes more sense to the community. The least intrusive way to do this that I found was the flang merge
approach. Now, because the project is not so small, we need a starting point that works in LLVM trunk, everything self-contained in /bolt with as few diffs as possible in /llvm, and then from there possibly work on evolving the project to other suggested organization
(such as breaking up BOLT in a lib in llvm/lib). But first we wanted to start with the rebase that we knew would take some time.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">That’s the gist of the current direction, thanks for pinging!<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">-Rafael<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal" style="margin-bottom:12pt"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>> on behalf of Andrey Bokhanko via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>
<b>Date: </b>Tuesday, January 26, 2021 at 2:31 AM<br>
<b>To: </b>llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>, Maksim Panchenko <<a href="mailto:maks@fb.com" target="_blank">maks@fb.com</a>><br>
<b>Subject: </b>Re: [llvm-dev] [RFC] BOLT: A Framework for Binary Analysis, Transformation, and Optimization</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">One more thing (to clarify my interest): my team is working on Golang<br>
support in BOLT, and we're keen to open-source our developments<br>
(pending approvals from the higher-ups). It's much more preferable for<br>
us to contribute our code to LLVM project.<br>
<br>
On Tue, Jan 26, 2021 at 1:26 PM Andrey Bokhanko<br>
<<a href="mailto:andreybokhanko@gmail.com" target="_blank">andreybokhanko@gmail.com</a>> wrote:<br>
><br>
> Hi Maksim,<br>
><br>
> Any updates on adding BOLT to LLVM?<br>
><br>
> If you need any help / support, feel free to ask. The World is waiting<br>
> for BOLT! :-)<br>
><br>
> Yours,<br>
> Andrey<br>
> ===<br>
> Director<br>
> Advanced Software Technology Lab<br>
> Huawei<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
<u></u><u></u></p>
</div>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>