Replace a bunch of complex ConstantPointerRef referring code with simple