https://github.com/nikic approved this pull request. LGTM The issue with subtracting pointers from different address spaces is a pre-existing one, but would be good to file an issue, because the codegen is incorrect. https://github.com/llvm/llvm-project/pull/210729