tschuett added a comment. Could that be a more general solution? You ask the target if address spaces A and B could alias? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124787/new/ https://reviews.llvm.org/D124787