Optimize for the cases where the pointer value is known at compile-time.