ptr: optimize {swap,replace,read}_ptr

Unlikely to ever be a measurable difference, but these might as well communicate all the known information to LLVM.