<br>Hi Justin,<div><br></div><div>I take the fact that nobody has replied as a sign that nobody really understands what you are asking.<br><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">

I was wondering if there was a quick way to reverse a function's CFG and, in turn, all basic blocks within it.  Assuming all variables are globals, is there a quick way to generate a function's reversal?  I highly doubt such functionality exists but I figured it was worth asking.  I'm trying to develop an "undo function" generator pass that would be able to restore system state (without state-saving) after determining an error occurred.  This is documented in, "Efficient Optimistic Parallel Simulations using Reverse Computation" by Carothers et al.[1]<br>


 </blockquote><div><br>I'm unaware of an easy way to "reverse the CFG" - but even if there was, I don't think that would solve your problem.  First, you will only be able to generate "undo" functions for a small subset of all possible functions - specifically, invertible functions.  Second, my intuition is that computing an inverse function will be significantly more involved than just reversing the CFG.<br>

</div><div><br></div><div>Could you be a little more specific about the problem you are dealing with?  How do Carothers et al. do the inversion?</div><div><br></div><div>-Joshua</div></div>
</div>