&quot;If we&#x27;re just talking about pure refactoring that doesn&#x27;t change any output, you could test that the generated machine code is identical. But then you have to ask, why isn&#x27;t there a stable API rather than all this refactoring churn?
&quot;<p>LLVM deliberately does not want a stable API.   It wants people to keep up with trunk.<p>They do this because they saw what has happened with other compilers, where the stable API became literally impossible to change over time.<p>This is one of the reasons GCC <i>still</i> has a crappy backend.  You either have to build a new API and port <i>everyone</i> over, or you have to find an incremental way to change an API interface with hundreds of random interface points.