Hi everyone, I'm writing a pass that inserts the llvm.experimental.stackmap intrinsic into the IR, and I'd like to record the locations of *all* live values whenever I insert the intrinsic (all this entails is adding values as arguments to the intrinsic). Is there any pre-existing analysis pass which can give me the live values at a given instruction in a basic block? Or do I need to write an analysis pass to calculate this information? I realize that live value analysis is usually performed during register allocation in the backend, but I was wondering if there was anything available in the optimizer. -- Rob Lyerly Graduate Research Assistant, Systems Software Research Group -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160324/7858a14a/attachment.html>
the statepoint code has a liveness algorithm you may be able to repurpose. If you want something faster, see https://hal.inria.fr/inria-00558509v1/document On Thu, Mar 24, 2016 at 12:35 PM, Rob Lyerly via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi everyone, > > I'm writing a pass that inserts the llvm.experimental.stackmap intrinsic > into the IR, and I'd like to record the locations of *all* live values > whenever I insert the intrinsic (all this entails is adding values as > arguments to the intrinsic). Is there any pre-existing analysis pass which > can give me the live values at a given instruction in a basic block? Or do > I need to write an analysis pass to calculate this information? > > I realize that live value analysis is usually performed during register > allocation in the backend, but I was wondering if there was anything > available in the optimizer. > > > -- > Rob Lyerly > Graduate Research Assistant, Systems Software Research Group > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://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/20160324/153f5ebf/attachment.html>
Hi Rob, On Thu, Mar 24, 2016 at 12:35 PM, Rob Lyerly via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Hi everyone,> I'm writing a pass that inserts the llvm.experimental.stackmap > intrinsic into the IR, and I'd like to record the locations of *all* > live values whenever I insert the intrinsic (all this entails isWhat is your definition of a live value? Some more context on what you intend to do with stackmaps will be helpful too. LLVM has a restricted form of a live value analysis that in the RewriteStatepointsForGC pass, and its intended use is to rewrite LLVM IR in a way that it can work with a precise compacting garbage collector; but it looks like you want something more general?> adding values as arguments to the intrinsic). Is there any > pre-existing analysis pass which can give me the live values at a > given instruction in a basic block? Or do I need to write an analysis > pass to calculate this information?-- Sanjoy
Hi Sanjoy, I'm interested in being able to reconstruct stack frames at runtime. In particular, I'd like to be able to unwind frames from a thread's stack and inspect the live values of each individual activation. I'd like to be able to find all live values (whether they be programmer-defined variables or compiler-generated intermediates) at arbitrary, but statically-known, locations in the the code. Right now, I need the locations of all live values at function call sites. Note that this *should* be a solved problem using DWARF debugging information -- the only reason I'm investigating this route is because it seems that clang/LLVM produce bad DWARF info [1]. [1] http://lists.llvm.org/pipermail/llvm-dev/2016-March/097509.html On Thu, Mar 24, 2016 at 3:43 PM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:> Hi Rob, > > On Thu, Mar 24, 2016 at 12:35 PM, Rob Lyerly via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > Hi everyone, > > > I'm writing a pass that inserts the llvm.experimental.stackmap > > intrinsic into the IR, and I'd like to record the locations of *all* > > live values whenever I insert the intrinsic (all this entails is > > What is your definition of a live value? Some more context on what > you intend to do with stackmaps will be helpful too. > > LLVM has a restricted form of a live value analysis that in the > RewriteStatepointsForGC pass, and its intended use is to rewrite LLVM > IR in a way that it can work with a precise compacting garbage > collector; but it looks like you want something more general? > > > adding values as arguments to the intrinsic). Is there any > > pre-existing analysis pass which can give me the live values at a > > given instruction in a basic block? Or do I need to write an analysis > > pass to calculate this information? > > -- Sanjoy >-- Rob Lyerly Graduate Research Assistant, Systems Software Research Group -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160326/9c16745b/attachment.html>