Only canonicalize loads that only store if the store's pointer operand is not reloaded elsewhere. It is common that the demotion of phis to loads/stores will create a number of loads that only store. However, the same location is loaded from in multiple locations. In this case, canonicalizing the loads to integers may not be the best thing to do, as eventually the loaded value will be used as it's original type, forcing bitcasts to be spread throughout the code.
Details
Details
Diff Detail
Diff Detail