Jeremy Salwen
2014-Aug-04 01:36 UTC
[LLVMdev] Matching up inlined basic blocks with original basic blocks.
Hello All, I have some data tied to the basic blocks in a function, and after inlining that function, I'd like to recover that data in the inlined version. Is there some way to match up the inlined version of the function with the original basic blocks? Thanks, Jeremy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140803/bb5c608f/attachment.html>
Chandler Carruth
2014-Aug-04 02:18 UTC
[LLVMdev] Matching up inlined basic blocks with original basic blocks.
On Sun, Aug 3, 2014 at 6:36 PM, Jeremy Salwen <jeremysalwen at gmail.com> wrote:> Hello All, > > I have some data tied to the basic blocks in a function, and after > inlining that function, I'd like to recover that data in the inlined > version. Is there some way to match up the inlined version of the function > with the original basic blocks? >See the code in CloneFunctionInto and CloneAndPruneFunctionInto. This is what does the actual inlining. You can see how that code tracks the basic blocks after inlining. Honestly, the right way to do this architecturally is for us to support metadata attached to basic blocks (if we don't already?) and then for the inliner to preserve it when inlining. Then you could use metadata as a container for your data. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140803/aa804fe8/attachment.html>
Hal Finkel
2014-Aug-04 04:25 UTC
[LLVMdev] Matching up inlined basic blocks with original basic blocks.
----- Original Message -----> From: "Chandler Carruth" <chandlerc at google.com> > To: "Jeremy Salwen" <jeremysalwen at gmail.com> > Cc: "llvmdev" <llvmdev at cs.uiuc.edu> > Sent: Sunday, August 3, 2014 9:18:38 PM > Subject: Re: [LLVMdev] Matching up inlined basic blocks with original basic blocks. > > On Sun, Aug 3, 2014 at 6:36 PM, Jeremy Salwen < > jeremysalwen at gmail.com > wrote: > > > > Hello All, > > I have some data tied to the basic blocks in a function, and after > inlining that function, I'd like to recover that data in the inlined > version. Is there some way to match up the inlined version of the > function with the original basic blocks? > See the code in CloneFunctionInto and CloneAndPruneFunctionInto. This > is what does the actual inlining. You can see how that code tracks > the basic blocks after inlining. > > > Honestly, the right way to do this architecturally is for us to > support metadata attached to basic blocks (if we don't already?) and > then for the inliner to preserve it when inlining. Then you could > use metadata as a container for your data.We don't currently support metadata on basic blocks. There was a patch for this some time ago, http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120507/142379.html. -Hal> _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Hal Finkel Assistant Computational Scientist Leadership Computing Facility Argonne National Laboratory
Jeremy Salwen
2014-Aug-04 06:45 UTC
[LLVMdev] Matching up inlined basic blocks with original basic blocks.
Hi Chandler, It seems that both functions use a VMap argument in which they create a map from old values to their cloned copies. This would work great, however, when I look in InlineFunction() (InlineFunction.cpp line 794), the VMap seems to be hidden from the caller, and there is an explicit comment "Scope to destroy VMap after cloning". Is InlineFunction() the wrong entry point for inlining a function? Or do I need to create a modified version that exposes the VMap? Thanks, Jeremy On Sun, Aug 3, 2014 at 10:18 PM, Chandler Carruth <chandlerc at google.com> wrote:> > On Sun, Aug 3, 2014 at 6:36 PM, Jeremy Salwen <jeremysalwen at gmail.com> > wrote: > >> Hello All, >> >> I have some data tied to the basic blocks in a function, and after >> inlining that function, I'd like to recover that data in the inlined >> version. Is there some way to match up the inlined version of the function >> with the original basic blocks? >> > > See the code in CloneFunctionInto and CloneAndPruneFunctionInto. This is > what does the actual inlining. You can see how that code tracks the basic > blocks after inlining. > > Honestly, the right way to do this architecturally is for us to support > metadata attached to basic blocks (if we don't already?) and then for the > inliner to preserve it when inlining. Then you could use metadata as a > container for your data. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140804/472887bf/attachment.html>
Apparently Analagous Threads
- [LLVMdev] Getting LNT to work with non-bash shell
- [LLVMdev] Debug Information for LLVM 2.6 and TOT
- [LLVMdev] Creating and implementing an analysis group out of tree
- [LLVMdev] Wondering how best to run inlining on a single function.
- [LLVMdev] Wondering how best to run inlining on a single function.