Ranjani Krishnan via llvm-dev
2020-Jun-22 06:13 UTC
[llvm-dev] Inlining functions from multiple assembly files
I am working on developing a method to do some analysis on Ada code. I have converted the high level code (multiple Ada files) to the corresponding LLVM IR (.s files) using the tool dragonegg. The structure of my code is such that there are function calls across these files. Is there any way to inline these function calls? That is if function A in A.s calls function B in B.s, can the code for function B be added in A.s using some flag or pass in LLVM, like the AlwaysInlinerLegacyPass? I need to do the analysis on the .s file, so doing it during linking or assembling will not help. -- Thanks, Ranjani -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200622/f3f8bfb8/attachment.html>
Robinson, Paul via llvm-dev
2020-Jun-23 15:03 UTC
[llvm-dev] Inlining functions from multiple assembly files
Hi Ranjani, As nobody else has answered you, I will give it a try, although I am not an expert in this area by any means. When you say “.s files” what I think of are assembler source text files, i.e., machine instructions. There is no mechanism for supporting inlining in that case. But then you also said they are LLVM IR files, which by convention in the LLVM project have a .ll extension. That’s a different story. I believe the correct tool for merging several IR files into one file would be llvm-link; once you have a single IR module, then everything would be available for your analysis. There might be more clever ways to do this, but I’m not aware of a way to extract a single function from one file to merge into another file as a separate IR pass. Hope this helps, --paulr From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Ranjani Krishnan via llvm-dev Sent: Monday, June 22, 2020 2:14 AM To: llvm-dev at lists.llvm.org Subject: [llvm-dev] Inlining functions from multiple assembly files I am working on developing a method to do some analysis on Ada code. I have converted the high level code (multiple Ada files) to the corresponding LLVM IR (.s files) using the tool dragonegg. The structure of my code is such that there are function calls across these files. Is there any way to inline these function calls? That is if function A in A.s calls function B in B.s, can the code for function B be added in A.s using some flag or pass in LLVM, like the AlwaysInlinerLegacyPass? I need to do the analysis on the .s file, so doing it during linking or assembling will not help. -- Thanks, Ranjani -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200623/e9453513/attachment.html>
Ranjani Krishnan via llvm-dev
2020-Jun-24 04:56 UTC
[llvm-dev] Inlining functions from multiple assembly files
Hi, Thank you very much for your response. I will try doing as you suggested. On Tue, Jun 23, 2020 at 8:33 PM Robinson, Paul <paul.robinson at sony.com> wrote:> Hi Ranjani, > > > > As nobody else has answered you, I will give it a try, although I am not > an expert in this area by any means. > > > > When you say “.s files” what I think of are assembler source text files, > i.e., machine instructions. There is no mechanism for supporting inlining > in that case. But then you also said they are LLVM IR files, which by > convention in the LLVM project have a .ll extension. That’s a different > story. I believe the correct tool for merging several IR files into one > file would be llvm-link; once you have a single IR module, then everything > would be available for your analysis. > > > > There might be more clever ways to do this, but I’m not aware of a way to > extract a single function from one file to merge into another file as a > separate IR pass. > > > > Hope this helps, > > --paulr > > > > *From:* llvm-dev <llvm-dev-bounces at lists.llvm.org> *On Behalf Of *Ranjani > Krishnan via llvm-dev > *Sent:* Monday, June 22, 2020 2:14 AM > *To:* llvm-dev at lists.llvm.org > *Subject:* [llvm-dev] Inlining functions from multiple assembly files > > > > I am working on developing a method to do some analysis on Ada code. I > have converted the high level code (multiple Ada files) to the > corresponding LLVM IR (.s files) using the tool dragonegg. The structure > of my code is such that there are function calls across these files. Is > there any way to inline these function calls? That is if function A in A.s > calls function B in B.s, can the code for function B be added in A.s using > some flag or pass in LLVM, like the AlwaysInlinerLegacyPass? > > > > I need to do the analysis on the .s file, so doing it during linking or > assembling will not help. > > > -- > > Thanks, > > Ranjani >-- Thanks, Ranjani -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200624/78ea90a3/attachment.html>
Sameer Abu Asal via llvm-dev
2020-Jun-24 06:51 UTC
[llvm-dev] Inlining functions from multiple assembly files
Hi Ranjani, If you are talking about LLVM IR when you said (Assembly); you might also want to look at LLVM Link Time optimizations: https://www.llvm.org/docs/LinkTimeOptimization.html --Sameer Abu Asal , On Mon, Jun 22, 2020 at 12:07 PM Ranjani Krishnan via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I am working on developing a method to do some analysis on Ada code. I > have converted the high level code (multiple Ada files) to the > corresponding LLVM IR (.s files) using the tool dragonegg. The structure > of my code is such that there are function calls across these files. Is > there any way to inline these function calls? That is if function A in A.s > calls function B in B.s, can the code for function B be added in A.s using > some flag or pass in LLVM, like the AlwaysInlinerLegacyPass? > > I need to do the analysis on the .s file, so doing it during linking or > assembling will not help. > > -- > Thanks, > Ranjani > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200623/f7ea5bc1/attachment-0001.html>
Ranjani Krishnan via llvm-dev
2020-Jun-25 05:43 UTC
[llvm-dev] Inlining functions from multiple assembly files
Ok, thanks a lot! Will go through it. On Wed, Jun 24, 2020 at 12:22 PM Sameer Abu Asal <sameer.abuasal at gmail.com> wrote:> Hi Ranjani, > > If you are talking about LLVM IR when you said (Assembly); you might also > want to look at LLVM Link Time optimizations: > https://www.llvm.org/docs/LinkTimeOptimization.html > > --Sameer Abu Asal , > > > > On Mon, Jun 22, 2020 at 12:07 PM Ranjani Krishnan via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> I am working on developing a method to do some analysis on Ada code. I >> have converted the high level code (multiple Ada files) to the >> corresponding LLVM IR (.s files) using the tool dragonegg. The structure >> of my code is such that there are function calls across these files. Is >> there any way to inline these function calls? That is if function A in A.s >> calls function B in B.s, can the code for function B be added in A.s using >> some flag or pass in LLVM, like the AlwaysInlinerLegacyPass? >> >> I need to do the analysis on the .s file, so doing it during linking or >> assembling will not help. >> >> -- >> Thanks, >> Ranjani >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >-- Thanks, Ranjani -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200625/18329607/attachment-0001.html>