<div dir="ltr"><div>TLDR; fast import reads a sequence of commands from stdin to write whole files / trees / commits directly into a compressed pack archive.<br></div>Primarily designed for bulk importing history from other source control systems.<br><div><br>If the git commands you are using were a significant performance problem, I figured this would be quicker.</div><div><br></div><div>Have you considered writing each function or even basic block to a separate file?<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 8, 2018 at 2:03 PM, Alexandre Isoard <span dir="ltr"><<a href="mailto:alexandre.isoard@gmail.com" target="_blank">alexandre.isoard@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Maybe. I can't compute the diff/patch for git though, it will have to do it itself. Would that still work?<div><br></div><div>I am not sure I will have time to work on improving that.</div><div>For those who want to try it out I put it there: <a href="https://reviews.llvm.org/D44244" target="_blank">https://reviews.llvm.<wbr>org/D44244</a></div><div><br></div><div>And yes, this uses all possible forms of ugly. :-)</div><div><div class="h5"><div><div><br><div class="gmail_quote"><div dir="ltr">On Wed, Mar 7, 2018, 18:14 Jeremy Lakeman <<a href="mailto:Jeremy.Lakeman@gmail.com" target="_blank">Jeremy.Lakeman@gmail.com</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 dir="ltr">Could you format the output so that it is compatible with git fast-import? <div><a href="https://www.git-scm.com/docs/git-fast-import" target="_blank">https://www.git-scm.com/docs/g<wbr>it-fast-import</a></div></div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 8, 2018 at 2:34 AM, Alexandre Isoard via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Today it is entirely in llvm. It is even more costly than -print-after-all as it:<div dir="auto">  - print to file</div><div dir="auto">  - print the entire module (after each basic block, for basic block passes, it will still print the entire module where only one basic block changed)</div><div dir="auto">  - call git 2 times (add then commit) and wait for them to finish (I even save all the empty commits)</div><div dir="auto"><br></div><div dir="auto">The reason I print the entire module is so that git is able to show/compress the change properly. Then a simple git log --patch show the change of each pass.</div><div dir="auto"><br></div><div dir="auto">Ideally, the -debug output of each pass would be piped as the git commit message, and the passes name+options would be the commit title. But I didn't have time to do that.</div><div dir="auto"><br></div><div dir="auto">My goal was not particularly to be efficient but to be thorough so as to preserve the maximum of behavioral information of each pass while not affecting their order and behavior.</div><div dir="auto"><br></div><div dir="auto">You are right, there could be major speed improvement gained by doing so as external processing. For instance, the output would be in the format that git patch takes as input. Could this be a GSoC?</div><div dir="auto"><br></div><div dir="auto">Today I use git filter-branch + opt as a post processing tool to generate the reg.dot files of the region info. In any way, the feature is a breath of fresh air in our development here. That's why I wanted to share. It will quickly become my reflex to debug with it... probably because I am at ease with git though.</div></div><div class="m_-5191227264175722003gmail-m_-4638014824975578823m_4589316128093275721HOEnZb"><div class="m_-5191227264175722003gmail-m_-4638014824975578823m_4589316128093275721h5"><br><div class="gmail_quote"><div dir="ltr">On Wed, Mar 7, 2018, 06:19 Alex Bradbury <<a href="mailto:asb@asbradbury.org" target="_blank">asb@asbradbury.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">On 6 March 2018 at 18:43, Alexandre Isoard via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" rel="noreferrer" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> Hello,<br>
><br>
> I had a stupid idea recently that turned out not so stupid after all. I<br>
> wanted to be able to "see" an entire pass pipeline in action to find<br>
> unnecessary transformations and/or missed opportunities and generally<br>
> improve the debug-ability of LLVM.<br>
><br>
> So as the title suggest, I implemented an equivalent of "-print-after-all"<br>
> but instead of printing into stdout I dump into a file that get commit into<br>
> a temporary git. There are some quirks with it but it's working and is<br>
> actually awesome. For example, at first sight, I see multiple time lcssa and<br>
> instcombine cancelling each other's work.<br>
><br>
> Of course, that has a big impact on compile time when enabled, but that's<br>
> still practical (git being quite good at its job) when debugging.<br>
><br>
> There are improvement I can make, but would you guys be interested in such<br>
> feature?<br>
<br>
Hi Alexandre. I can definitely see how it could be useful to track<br>
changes through git commits, and take advantage of your favourite repo<br>
history viewer to see changes. How much of your current implementation<br>
is handled via modifications to LLVM vs an external helper script? For<br>
instance, I might imagine trying to achieve something similar through<br>
a script that parses the output of -print-after-all in order to create<br>
the desired files+commits.<br>
<br>
Best,<br>
<br>
Alex<br>
</blockquote></div>
</div></div><br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">______________________________<wbr>_________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div></div></blockquote></div></div></div></div></div></div>
</blockquote></div><br></div>