https://github.com/MarkMurrayARM approved this pull request. This looks like the code I looked at a while back, but cleaned up, and with better testing. LGTM. https://github.com/llvm/llvm-project/pull/110285