<div dir="ltr">If you want to do cross-file optimization, you're looking for/want to use something like LTO or ThinLTO. (see, for instance, the whole program devirtualization work done with ThinLTO recently)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 24, 2021 at 12:28 PM Mohannad Ismail 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 dir="ltr">Greetings everyone,<div><br></div><div>I currently have a pass (Pass 2) that does some transformations. What I want to do is to have a pass (Pass 1) that runs before Pass 2, collects some IR information, stores it in a data structure and passes the data structure to Pass 2 so that I can use it for specific transformations. I think this can be done with getAnalysisUsage, but I'm not sure how. I would like to know how to do that exactly, if it's possible.</div><div><br></div><div>Another thing, and this is the tricky part, is that I want Pass 1 to run on all the source files I have first before Pass 2 runs and pass a collective data structure to Pass 2. In other words, I want Pass 1 to run across all the modules and source files first, collect information, pass it to Pass 2 then Pass 2 runs. Is there a way to tell LLVM to do this type of "double compilation"?</div><div><br></div><div>Hope I was able to explain this well enough. Please let me know if I wasn't clear or if you have any questions. Thank you very much!<br></div><div><br></div><div>Best regards,</div><div>Mohannad Ismail</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>