vitalybuka wrote: I suspect SafeStack require address space of UnsafeStackPtr and StackPtr is the same. Maybe just fatal error if address space of PointerType::getUnqual != DL.getAllocaPtrType? https://github.com/llvm/llvm-project/pull/112536