https://github.com/s-perron commented: The implementation looks good to me. I just wonder about one of the tests. I'd like to know why we need to handle that case, and how prevalent the `addrspacecast`s will be. https://github.com/llvm/llvm-project/pull/116636