GlobalOpt can optimize a global with undef initializer and a single store to put the stored value into the initializer instead. Currently, this requires the type of the global and the store to match.
This patch extends support to cases with different types (but same size), in which case we create a new global to replace the old one.