https://github.com/fhahn commented: Is there any benefit from moving this out? It potentially makes it accessible from other files, but I think this is not desirable, as we should not be adding any new uses of the legacy cost model https://github.com/llvm/llvm-project/pull/159093