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