https://github.com/arichardson approved this pull request. All the ptrtoaddr logic looks good to me but I'm not particularly familiar with SCEV so I can only approve with regards to the pointer semantics. https://github.com/llvm/llvm-project/pull/180244