[LLVMdev] Reversing a function's CFG?

Joshua Warner joshuawarner32 at gmail.com
Wed Mar 23 09:24:35 PDT 2011


Hi Justin,

I take the fact that nobody has replied as a sign that nobody really
understands what you are asking.


> 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]
>


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.

Could you be a little more specific about the problem you are dealing with?
 How do Carothers et al. do the inversion?

-Joshua
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110323/da092c7a/attachment.html>


More information about the llvm-dev mailing list