<div dir="ltr"><div><div><div>Hi Sanjoy & Daniel,<br><br></div>Thanks for your insights!<br><br></div>I've actually got kind of an esoteric use case -- we're exploring how to efficiently transform application state between ABIs at runtime, and thus we need a lot of info from the compiler on how things are laid out.  I'm going to follow Daniel's suggestion and try to implement an analysis pass based on the approaches detailed in [1].  If you think this is useful for LLVM in general, I'd be happy to contribute it to the community.  A word of warning -- I'll probably need some hand-holding to get it to an LLVM-acceptable level :).<br><br></div><div>On representing this information -- I was planning on generating meta-data based on the analysis (similar to what happens with "-g"), but I can definitely explore using operand bundles to hold the data.<br></div><br>[1] <a href="https://hal.inria.fr/inria-00558509v1/document">https://hal.inria.fr/inria-00558509v1/document</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 27, 2016 at 1:18 AM, Sanjoy Das <span dir="ltr"><<a href="mailto:sanjoy@playingwithpointers.com" target="_blank">sanjoy@playingwithpointers.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Mar 26, 2016 at 12:52 PM, Rob Lyerly <<a href="mailto:rlyerly@vt.edu">rlyerly@vt.edu</a>> wrote:<br>
><br>
> Hi Sanjoy,<br>
><br>
> I'm interested in being able to reconstruct stack frames at runtime.<br>
> In particular, I'd like to be able to unwind frames from a thread's<br>
> stack and inspect the live values of each individual activation.  I'd<br>
> like to be able to find all live values (whether they be<br>
> programmer-defined variables or compiler-generated intermediates) at<br>
> arbitrary, but statically-known, locations in the the code.  Right<br>
> now, I need the locations of all live values at function call sites.<br>
<br>
</span>This sound very interesting!  What do you intend to use this mechanism<br>
for, if you don't mind sharing?<br>
<br>
The liveness analysis in the statepoint lowering code cannot be<br>
directly used for this, but it should be possible to extract out a<br>
"liveness analysis utility" that is usable both by the statepoint<br>
lowering code and by whatever it is that you're trying to do.  I'll be<br>
happy to review changes in this direction -- let me know if you're<br>
interested in taking this on, and we can work out the details.<br>
<br>
As an aside, have you thought about how you'd represent and lower this<br>
information ("this information" == the set of values live over a<br>
function call)?  LLVM has a notion called operand bundles which may be<br>
useful for you here -- we use it to represent deoptimization state for<br>
specific physical frames, that lets the runtime replace the stack<br>
frames running compiled code with stack frames running interpreted<br>
code (is this similar to what you're trying to do?).<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Sanjoy<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><span>Rob Lyerly</span><br></div><div>Graduate Research Assistant, Systems Software Research Group<br><br></div><div><img src="http://www.branding.unirel.vt.edu/images/S_logo-tagline-old.jpg" height="40" width="140">   <img src="http://www.oocities.org/rainforestwind/divider_black_vertical.jpg" height="36" width="8"><img src="http://www.ece.vt.edu/images/inside-top-ecelogo.png" height="47" width="232"></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>