Game behavior can be tied so closely to quirky hardware behavior that I doubt such a tool would be simple to create. You’d have to verify that your code produces the same hardware state. And different (ie more efficient) code almost by definition produces a different hardware state than the original code. Thus changing the game.
Really though? You have to try really hard to make your code that unstable - and well written code isn't that.
Seems more like voodoo.