Currently optimizeMemoryInst requires that all of the AddrModes it sees are identical. This patch makes it capable of tracking multiple AddrModes, so long as they differ in at most one field.
This patch does nothing by itself, but later patches will make use of it to insert or reuse phi or select instructions for the differing fields.
I cannot understand why you need a AddrModeUser. The only one use of this field I see is for checking that user of AddrMode is Phi or Select.
However according to usage of AddressingModeCombiner AddrModeUser cannot be anything else.
Do I miss anything?