https://github.com/huntergr-arm requested changes to this pull request. I think quite a few changes are needed before we can land this; feel free to disagree, but I think we can remove quite a lot of code and make it more robust. https://github.com/llvm/llvm-project/pull/92418