https://github.com/david-arm approved this pull request. LGTM! Wow, this was a pretty serious bug. Thanks for the fix. Looks like we were also generating incorrect runtime checks. https://github.com/llvm/llvm-project/pull/130118