If you know Ruby more than you know LLVM and want to see a practical example, I gave a talk about the same idea in the context of Ruby <a href="http://chrisseaton.com/rubytruffle/deoptimizing/" rel="nofollow">http://chrisseaton.com/rubytruffle/deoptimizing/</a>